我正在尝试使用 LootLocker 在 Unity 中生成用户内容。身份验证工作正常,但无论如何我都无法创建资产。我尝试了2.1.1和1.2.7版本。这是我正在使用的代码:
public class LootLockerManager : MonoBehaviour
{
void Start()
{
DontDestroyOnLoad(gameObject);
GuestLogin();
}
public void TakeScreenshot(string levelName)
{
string filePath = Directory.GetCurrentDirectory() + "/Assets/Screenshots/";
ScreenCapture.CaptureScreenshot(Path.Combine(filePath, levelName + "-screenshot.png"));
}
IEnumerator WaitScreenshot(string levelName)
{
TakeScreenshot(levelName);
yield return new WaitForEndOfFrame();
}
public void SaveLevelCloud(string inputName)
{
string name = "New Asset Candidate";
LootLockerSDKManager.CreatingAnAssetCandidate(name, (response) =>
{
if (response.success)
{
Debug.LogWarning("Sucess creating asset candidate");
Debug.LogWarning(response.text);
//UploadLevelData(response.asset_candidate_id, inputName);
}
else
{
Debug.LogWarning("Error creating asset candidate");
Debug.LogWarning(response.text);
}
});
}
public void GuestLogin()
{
TextMeshProUGUI logStatus = GameObject.FindGameObjectWithTag("LogStatusText").GetComponent<TextMeshProUGUI>();
LootLockerSDKManager.StartGuestSession((response) =>
{
if (!response.success)
{
SaveLevelCloud("test");
return;
}
});
}
}
提前致谢。
和我的情况一样, 兄弟你修好了吗?