示例#1
0
    public VRTK.VRTK_SDKManager SDKManager()
    {
        if (!_SDKManager)
        {
            var temp = GameObject.FindGameObjectWithTag("SDKManager");
            if (temp)
            {
                _SDKManager = temp.GetComponent <VRTK.VRTK_SDKManager>();
            }
            if (!_SDKManager)
            {
                _SDKManager = Instantiate(sdkManagerPrefab, Vector3.zero, Quaternion.identity);
            }
        }
        else if (!GameMaster.Instance.SceneMaster.IsInCurrentScene(_SDKManager.gameObject))
        {
            SceneMaster.MoveToScene(_SDKManager.gameObject);
        }
        else if (_SDKManager.transform.parent == transform)
        {
            transform.parent = null;
        }

        return(_SDKManager);
    }