Example #1
0
 private void OnDestroy()
 {
     if (instance == this)
     {
         instance = null;
     }
 }
Example #2
0
    void Awake()
    {
        if (instance != null)
        {
            throw new System.Exception("You have more than 1 AvatarHandler in the scene.");
        }

        // Initialize the static class variables
        instance = this;
    }
Example #3
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        vrManager = GetComponent <WebVRManager>();
        if (vrManager.vrState == WebVRState.ENABLED)
        {
            head = vrHead;
        }
    }
Example #4
0
    private void Update()
    {
        // Avatar
        if (!avatar && HPTKCore.core.model.avatars.Count > 0)
        {
            avatar = HPTKCore.core.model.avatars[0].handler;
        }

        // Camera rig
        if (!cameraRig)
        {
            searchResult = GameObject.FindObjectOfType <OVRCameraRig>();

            if (searchResult != null)
            {
                cameraRig = searchResult;
                Apply();
            }
        }
    }