Пример #1
0
        public virtual void Install(bool reset)
        {
#if UNITY_EDITOR
            if (pointerPrefab == null)
            {
                pointerPrefab = ResourceExt.EditorLoadAsset <GameObject>("Assets/Juniper/Assets/Prefabs/Rigs/DiskProbe2018.2.prefab");
            }

            if (laserPointerNormalMaterial == null)
            {
                laserPointerNormalMaterial = ResourceExt.EditorLoadAsset <Material>("Assets/Juniper/Assets/Materials/LaserPointer_White.mat");
            }

            if (laserPointerEnabledMaterial == null)
            {
                laserPointerEnabledMaterial = ResourceExt.EditorLoadAsset <Material>("Assets/Juniper/Assets/Materials/LaserPointer_Green.mat");
            }

            if (laserPointerDisabledMaterial == null)
            {
                laserPointerDisabledMaterial = ResourceExt.EditorLoadAsset <Material>("Assets/Juniper/Assets/Materials/LaserPointer_Red.mat");
            }
#endif

            Find.Any(out stage);

            stage.Install(reset);
            stage.IndependentHead = HasFloorPosition;

            Gaze   = MakePointer <GazePointer>(stage.Head, "GazePointer");
            Mouse  = MakePointer <Mouse>(stage.Head, "Mouse");
            Helper = MakePointer <NetworkPointer>(stage.Hands, "Network");

            Touches = new TouchPoint[10];
            for (var i = 0; i < Touches.Length; ++i)
            {
                Touches[i]          = MakePointer <TouchPoint>(stage.Head, $"Touches/TouchPoint{i.ToString()}");
                Touches[i].fingerID = i;
            }

            Controllers = MotionController.MakeControllers(MakeHandPointer <MotionController>);
            Hands       = HandTracker.MakeControllers(MakeHandPointer <HandTracker>);

            Voice = this.FindClosest <KeywordRecognizer>();
        }