한국어
Unity 게임을 B3 Unity SDK로 basement에 통합하여 Unity 내에서 간단한 함수로 모든 런처 기능에 쉽게 접근할 수 있습니다.
SDK 다운로드
Unity 프로젝트에 설치
SDK 초기화
B3LauncherClient.TriggerRulesEngine(new B3LauncherClient.TriggerRulesEngineBody { launcherJwt = B3Instance.Instance.SessionJWT ?? jwtInput.text, trigger = "open-tip-modal", otherWallet = otherWalletInput.text, }, null);
// 현재 세션 JWT에 접근 string sessionToken = B3Instance.Instance.SessionJWT; // 사용자가 인증되었는지 확인 if (B3Instance.Instance.IsAuthenticated) { // 사용자가 로그인되어 B3 서비스와 상호 작용할 준비가 되었습니다 Debug.Log("User authenticated successfully"); }
콜백 기반 호출
B3LauncherClient.SomeAPICall(requestData, (response) => { // 응답 처리 Debug.Log("API call completed"); });
Async/Await 호출
public async void CallAPI() { var response = await B3LauncherClient.SomeAPICallAsync(requestData); // 응답 처리 Debug.Log("API call completed"); }
WebGL 웹훅
// 웹훅 핸들러 등록 B3Instance.Instance.OnWebhookReceived += HandleWebhook; private void HandleWebhook(WebhookData data) { // 들어오는 웹훅 데이터 처리 Debug.Log($"Received webhook: {data.type}"); }