Пример #1
0
        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();
            }
        }
Пример #2
0
    void Start()
    {
        // Disable the pointer graphic (until the user holds down on the touchpad)
        Pointer.enabled = false;

        // Standard plane mesh used for "fade out" graphic when you teleport
        // This way you don't need to supply a simple plane mesh in the inspector
        PlaneMesh = new Mesh();
        Vector3[] verts = new Vector3[]
        {
            new Vector3(-1, -1, 0),
            new Vector3(-1, 1, 0),
            new Vector3(1, 1, 0),
            new Vector3(1, -1, 0)
        };
        int[] elts = new int[] { 0, 1, 2, 0, 2, 3 };
        PlaneMesh.vertices  = verts;
        PlaneMesh.triangles = elts;
        PlaneMesh.RecalculateBounds();

        // Set some standard variables
        cam = GetComponent <Camera>();

        MaterialFadeID    = Shader.PropertyToID("_Fade");
        EnabledAnimatorID = Animator.StringToHash("Enabled");

        NavmeshBorder = Navmesh.GetComponent <BorderRenderer>();
        RoomBorder    = GetComponent <BorderRenderer>();

        Vector3 p0, p1, p2, p3;

        if (GetChaperoneBounds(out p0, out p1, out p2, out p3))
        {
            RoomBorder.Points = new Vector3[][]
            {
                new Vector3[] {
                    p0, p1, p2, p3, p0
                }
            };
        }
    }