Ejemplo n.º 1
0
        void Awake()
        {
            /*
             * if (VRSettings.enabled){
             *      VR = true;
             * } else {
             *      VR = false;
             * }
             */
            if (VirtualRealitySupported)
            {
                manager = gameObject.AddComponent <OffScreenIndicatorManagerVR>();
                (manager as OffScreenIndicatorManagerVR).cameraDistance = VR_cameraDistance;
                (manager as OffScreenIndicatorManagerVR).radius         = VR_radius;
                (manager as OffScreenIndicatorManagerVR).indicatorScale = VR_indicatorScale;
                (manager as OffScreenIndicatorManagerVR).CreateIndicatorsParent();
            }
            else
            {
                manager = gameObject.AddComponent <OffScreenIndicatorManagerCanvas>();
                (manager as OffScreenIndicatorManagerCanvas).indicatorsParentObj = canvas;
                (manager as OffScreenIndicatorManagerCanvas).circleRadius        = Canvas_circleRadius;
                (manager as OffScreenIndicatorManagerCanvas).border        = Canvas_border;
                (manager as OffScreenIndicatorManagerCanvas).indicatorSize = Canvas_indicatorSize;
            }
            manager.indicators  = indicators;
            manager.enableDebug = enableDebug;
            manager.CheckFields();

            /* foreach(FixedTarget target in targets){
             *      AddIndicator(target.target, target.indicatorID);
             * } */
        }
        void Awake()
        {
            /*
             * if (VRSettings.enabled){
             *      VR = true;
             * } else {
             *      VR = false;
             * }
             */
            //SetCamera()
            if (VirtualRealitySupported)
            {
                manager = gameObject.AddComponent <OffScreenIndicatorManagerVRDoubleEyes>();
                (manager as OffScreenIndicatorManagerVRDoubleEyes).cameraDistance = VR_cameraDistance;
                (manager as OffScreenIndicatorManagerVRDoubleEyes).radius         = VR_radius;
                (manager as OffScreenIndicatorManagerVRDoubleEyes).indicatorScale = VR_indicatorScale;

                (manager as OffScreenIndicatorManagerVRDoubleEyes).CanvasL = CanvasL;
                (manager as OffScreenIndicatorManagerVRDoubleEyes).CanvasR = CanvasR;

                (manager as OffScreenIndicatorManagerVRDoubleEyes).SetCamera(eyeCamera);
                (manager as OffScreenIndicatorManagerVRDoubleEyes).SetRaycastRoot(RaycastRoot);
                //(manager as OffScreenIndicatorManagerVRDoubleEyes).SetLayer(this.eyeLayer);
                (manager as OffScreenIndicatorManagerVRDoubleEyes).CreateIndicatorsParent();
            }
            else
            {
                manager = gameObject.AddComponent <OffScreenIndicatorManagerCanvas>();
                (manager as OffScreenIndicatorManagerCanvas).indicatorsParentObj = canvas;
                (manager as OffScreenIndicatorManagerCanvas).circleRadius        = Canvas_circleRadius;
                (manager as OffScreenIndicatorManagerCanvas).border        = Canvas_border;
                (manager as OffScreenIndicatorManagerCanvas).indicatorSize = Canvas_indicatorSize;
            }
            manager.indicators = indicators;
            //manager.targetInfos = targetInfos;
            manager.enableDebug = enableDebug;
            manager.CheckFields();
            //foreach(FixedTarget target in targets){
            //	//AddIndicator(target.target, target.indicatorID,eye);
            //}
        }