【问题标题】:Oculus entitlement gear vrOculus 权利装备 vr
【发布时间】:2017-11-17 08:05:44
【问题描述】:

我正在使用 Oculus Utils 1.9.0 在 Unity 5.6.1p1 中为 Gear VR 开发游戏。它现在在开发者控制台上进行技术审查。但是,即使将其添加到项目中,我仍然会收到 entitlement 错误。

这是他们的解释:

您的应用似乎不支持权利检查以防止未经授权使用您的内容。可以在此处找到有关如何添加权利检查的文档:https://developer.oculus.com/documentation/platform/latest/concepts/pgsg-get-started-with-sdk/

这是我的授权代码:

public class PlatformManager : MonoBehaviour
{
    public static bool entitled = false;
    private static PlatformManager s_instance;
    private ulong m_myID;

    private string m_myOculusID;

    void Awake()
    {
        if(s_instance != null)
        {
            Destroy(gameObject);
            return;
        }
        s_instance = this;
        DontDestroyOnLoad(gameObject);
        Core.Initialize();
    }

    private void Start()
    {
        entitled = false;
        Entitlements.IsUserEntitledToApplication().OnComplete(IsEntitledCallback);
    }

    void IsEntitledCallback(Message msg)
    {
        if(msg.IsError)
        {
            entitled = false;
            TerminateWithError(msg);
            return;
        }
        entitled = true;
        Users.GetLoggedInUser().OnComplete(GetLoggedInUserCallback);
    }

    public static void TerminateWithError(Message msg)
    {
        Debug.Log("Error: " + msg.GetError().Message);
        UnityEngine.Application.Quit();
    }

    void GetLoggedInUserCallback(Message<User> msg)
    {
        if(msg.IsError)
        {
            TerminateWithError(msg);
            return;
        }

        m_myID = msg.Data.ID;
        m_myOculusID = msg.Data.OculusID;
    }
}

在获得授权后,我没有对 ID 做任何事情。我应该做点什么吗?我的代码有错误吗?获得授权后,我确实获得了真正的价值。

【问题讨论】:

  • 您找到解决方案了吗?我们有同样的问题。也许调用 Application.Quit() 是不够的?我不知道。
  • 我在他们的论坛上收到了回复。如果他没有权限,我必须在退出应用程序之前通知用户。我已经发送了新版本并等待新的回复。如果可行,将发布答案。

标签: unity3d virtual-reality oculus gear-vr


【解决方案1】:

我的应用已通过权利检查和技术审查。代码很好,但我不得不添加一条消息让用户知道他没有权限,然后退出应用程序。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-21
    • 2018-06-25
    相关资源
    最近更新 更多