### 뒤끝 초기화 로직 (수정 전) Source: https://developer.thebackend.io/unity3d/guide/guideLine/login/ready 뒤끝 SDK를 초기화하는 기본적인 로직입니다. Unity의 Start 함수 내에서 Backend.Initialize를 호출합니다. ```csharp using System.Collections; using System.Collections.Generic; using UnityEngine; // 뒤끝 SDK namespace 추가 using BackEnd; public class BackendManager : MonoBehaviour { void Start() { var bro = Backend.Initialize(true); // 뒤끝 초기화 // 뒤끝 초기화에 대한 응답값 if (bro.IsSuccess()) { Debug.Log("초기화 성공 : " + bro); // 성공일 경우 statusCode 204 Success } else { Debug.LogError("초기화 실패 : " + bro); // 실패일 경우 statusCode 400대 에러 발생 } } } ``` -------------------------------- ### Get User Ranking List (Asynchronous) Source: https://developer.thebackend.io/unity3d/guide/uRanking/user/getRankTable Use this asynchronous version to get the user ranking list without blocking the main thread. A callback function is required to handle the response. ```csharp Backend.URank.User.GetRankTableList(callback=> { // 이후 처리 }); ``` -------------------------------- ### Sample Implementation for GetProductList Source: https://developer.thebackend.io/unity3d/guide/billing/productList Demonstrates how to call GetProductList, parse the JSON response, and populate a list of ProductItem objects. ```csharp public void GetProductList() { var bro = Backend.TBC.GetProductList(); JsonData json = bro.FlattenRows(); List productList = new List(); for (int i = 0; i < json.Count; i++) { ProductItem product = new ProductItem(); product.TBC = json[i]["TBC"].ToString(); product.inDate = json[i]["inDate"].ToString(); product.uuid = json[i]["uuid"].ToString(); product.name = json[i]["name"].ToString(); product.explain = json[i]["explain"].ToString(); productList.Add(product); Debug.Log(product.ToString()); } } ``` -------------------------------- ### Get Product List (SendQueue) Source: https://developer.thebackend.io/unity3d/guide/billing/productList Enqueue the GetProductList call to manage requests and handle the response in a callback. ```csharp SendQueue.Enqueue(Backend.TBC.GetProductList, callback => { // 이후 처리 }); ``` -------------------------------- ### BackendLogin.cs: CustomSignUp 함수 수정 (회원가입 로직 추가) Source: https://developer.thebackend.io/unity3d/guide/guideLine/login/signup 회원가입 요청을 처리하고 성공 또는 실패 로그를 출력합니다. 뒤끝 SDK의 CustomSignUp 함수를 호출합니다. ```csharp public void CustomSignUp(string id, string pw) { // Step 2. 회원가입 구현하기 로직 } ``` ```csharp public void CustomSignUp(string id, string pw) { Debug.Log("회원가입을 요청합니다."); var bro = Backend.BMember.CustomSignUp(id, pw); if (bro.IsSuccess()) { Debug.Log("회원가입에 성공했습니다. : " + bro); } else { Debug.LogError("회원가입에 실패했습니다. : " + bro); } } ``` -------------------------------- ### Get Product List (Synchronous) Source: https://developer.thebackend.io/unity3d/guide/billing/productList Call this method to synchronously retrieve the list of registered game currency items. ```csharp Backend.TBC.GetProductList(); ``` -------------------------------- ### 뒤끝 초기화 및 로그인 테스트 (C#) Source: https://developer.thebackend.io/unity3d/guide/guideLine/gamedata/ready Unity에서 뒤끝 SDK를 초기화하고 사용자 로그인을 비동기적으로 처리하는 예제입니다. 뒤끝 초기화 성공/실패 여부를 디버그 로그로 출력합니다. ```csharp using UnityEngine; using System.Threading.Tasks; // 뒤끝 SDK namespace 추가 using BackEnd; public class BackendManager : MonoBehaviour { void Start() { var bro = Backend.Initialize(true); // 뒤끝 초기화 // 뒤끝 초기화에 대한 응답값 if (bro.IsSuccess()) { Debug.Log("초기화 성공 : " + bro); // 성공일 경우 statusCode 204 Success } else { Debug.LogError("초기화 실패 : " + bro); // 실패일 경우 statusCode 400대 에러 발생 } Test(); } // 동기 함수를 비동기에서 호출하게 해주는 함수(유니티 UI 접근 불가) async void Test() { await Task.Run(() => { BackendLogin.Instance.CustomLogin("user1", "1234"); // 뒤끝 로그인 // 게임 정보 기능 구현 로직 추가 Debug.Log("테스트를 종료합니다."); }); } } ``` -------------------------------- ### Get Default Question Form Source: https://developer.thebackend.io/unity3d/guide/social/GetPostListV2 Retrieves the default inquiry form, which is customized based on the user's country. ```APIDOC ## Get Default Question Form ### Description Fetches the default inquiry form. The form returned is tailored to the user's country, providing a localized support experience. ### Method `Backend.Question.GetDefaultQuestionForm` ### Request Example ```csharp var bro = Backend.Question.GetDefaultQuestionForm(); ``` ``` -------------------------------- ### 로그인 전용 스크립트 (BackendLogin.cs) Source: https://developer.thebackend.io/unity3d/guide/guideLine/login/ready 회원가입, 로그인, 닉네임 변경 등 로그인 관련 기능을 관리하기 위한 싱글톤 패턴 기반의 스크립트입니다. 각 기능별 메서드 구현은 추후 추가됩니다. ```csharp using System.Collections; using System.Collections.Generic; using UnityEngine; // 뒤끝 SDK namespace 추가 using BackEnd; public class BackendLogin { private static BackendLogin _instance = null; public static BackendLogin Instance { get { if (_instance == null) { _instance = new BackendLogin(); } return _instance; } } public void CustomSignUp(string id, string pw) { // Step 2. 회원가입 구현하기 로직 } public void CustomLogin(string id, string pw) { // Step 3. 로그인 구현하기 로직 } public void UpdateNickname(string nickname) { // Step 4. 닉네임 변경 구현하기 로직 } } ``` -------------------------------- ### Get Default Question Form Source: https://developer.thebackend.io/unity3d/guide/update Retrieves the default 1:1 inquiry form, customized based on the console's country settings. ```APIDOC ## Get Default Question Form ### Description Retrieves the default 1:1 inquiry form, customized based on the console's country settings. ### Method `Backend.Question.GetDefaultQuestionForm` ### Response #### Success Response (200) - `bro` (var) - A variable holding the returned question form data. ### Request Example ```csharp var bro = Backend.Question.GetDefaultQuestionForm(); ``` ``` -------------------------------- ### BackendManager.cs: CustomSignUp 함수 호출 추가 Source: https://developer.thebackend.io/unity3d/guide/guideLine/login/signup 게임 실행 시 뒤끝 초기화 후에 CustomSignUp 함수를 호출하도록 추가합니다. 테스트를 위해 "user1"과 "1234"를 사용합니다. ```csharp async void Test() { await Task.Run(() => { // 추후 테스트 케이스 추가 Debug.Log("테스트를 종료합니다."); }); } ``` ```csharp async void Test() { await Task.Run(() => { BackendLogin.Instance.CustomSignUp("user1", "1234"); // [추가] 뒤끝 회원가입 함수 Debug.Log("테스트를 종료합니다."); }); } ``` -------------------------------- ### Get Product List (Asynchronous) Source: https://developer.thebackend.io/unity3d/guide/billing/productList Use this asynchronous method to retrieve the list of game currency items and process the result in a callback. ```csharp Backend.TBC.GetProductList( ( callback ) => { // 이후 처리 }); ```