private IEnumerator Start()
        {
            yield return(null);

            ToggleGosForPreview(true, _gosToHideInPreview);
            ToggleGosForPreview(false, _gosToShowInPreview);

            //If user has checked the "Is Test Scene" checkbox load the current scene
            if (_isTestScene)
            {
                //make sure we have a navmesh
                if (_navMesh == null)
                {
                    _navMesh = FindObjectOfType <ViveNavMesh>();
                    if (_navMesh != null)
                    {
                        _navMeshAnimator = _navMesh.GetComponent <Animator>();

                        ParabolicPointer pointer = FindObjectOfType <ParabolicPointer>();
                        if (pointer != null)
                        {
                            pointer.NavMesh = _navMesh;
                        }

                        TeleportVive teleporter = FindObjectOfType <TeleportVive>();
                        if (teleporter != null)
                        {
                            teleporter.NavAnimator = _navMeshAnimator;
                        }
                    }
                }

                LoadTestScene();
            }
        }
Example #2
0
    void Start()
    {
        m_controllerLeft  = transform.FindChild("Controller (left)").GetComponent <SteamVR_TrackedController>();
        m_controllerRight = transform.FindChild("Controller (right)").GetComponent <SteamVR_TrackedController>();

        m_teleporter = GetComponentInChildren <TeleportVive>();
        m_teleporter.SetActiveController(m_controllerLeft.GetComponent <SteamVR_TrackedObject>());

        m_controllerLeft.PadClicked   += onPadClickedLeft;          // TP init
        m_controllerLeft.PadUnclicked += onPadUnClickedLeft;        // TP launch

        m_controllerRight.PadClicked += onPadClickedRight;          // Take in inventory

        m_controllerRight.Gripped   += onGrabRight;                 // Take obj
        m_controllerRight.Ungripped += onUnGrabRight;               // Drop obj

        m_controllerLeft.TriggerClicked  += onTriggerClicked;       // interract
        m_controllerRight.TriggerClicked += onTriggerClicked;

        m_controllerLeft.MenuButtonClicked += onMenuClickLeft;      // Main menu
    }
Example #3
0
    //Adds one NVRHand as a controller for the Vive Teleporter
    void Start()
    {
        teleporterScript = gameObject.GetComponent <TeleportVive>();

        if (teleporterScript != null)
        {
            if (nvrHand != null)
            {
                teleporterScript.Controllers    = new SteamVR_TrackedObject[1];
                teleporterScript.Controllers[0] = nvrHand.GetComponent <SteamVR_TrackedObject>();
                Debug.Log("Controller added as teleporter");
            }
            else
            {
                Debug.LogError("No NVRHand set in SteamVRControllerAdder");
            }
        }
        else
        {
            Debug.LogError("No Vive Teleporter attached to SteamVRControllerAdder");
        }
    }
Example #4
0
 void Awake()
 {
     teleporter = GetComponent <TeleportVive>();
 }