Example #1
0
        protected virtual void Awake()
        {
            if (instance == null)
            {
                instance = this;
            }
            else if (instance != this)
            {
                Destroy(gameObject);
            }

            var sdkManager = VRTK_SDKManager.instance;

            if (sdkManager != null && sdkManager.persistOnLoad)
            {
                DontDestroyOnLoad(gameObject);
            }
        }
Example #2
0
        protected virtual void Awake()
        {
            if (instance == null)
            {
                instance = this;
            }
            else if (instance != this)
            {
                Destroy(gameObject);
            }

            var sdkManager = VRTK_SDKManager.instance;

            if (sdkManager != null && sdkManager.persistOnLoad)
            {
                DontDestroyOnLoad(gameObject);
            }

            haptics          = gameObject.AddComponent <VRTK_Haptics>();
            objectAppearance = gameObject.AddComponent <VRTK_ObjectAppearance>();
        }