コード例 #1
0
ファイル: AGHInterpreter.cs プロジェクト: Eusth/IOVR
        //public override bool IsBody(Collider collider)
        //{
        //    VRLog.Info("Is Body? {0} {1}", collider.name, LayerMask.LayerToName(collider.gameObject.layer));
        //    return collider.gameObject.layer > 0;
        //}

        protected override void OnStart()
        {
            base.OnStart();

            var camPosType = typeof(CameraPosition);

            _interestingFields = _interestingFieldNames.Select(name => camPosType.GetField(name, BindingFlags.Instance | BindingFlags.NonPublic)).ToArray();


            var bgGrabber = new ScreenGrabber(1280, 720, ScreenGrabber.FromList(
                                                  "Camera_BG",     // backgrounds
                                                  "Camera_Main",   // no idea
                                                  "Camera_Effect", // effects (e.g. vignette?)
                                                  "Camera"         // cinematics
                                                  ));

            _BGDisplay = GUIQuad.Create(bgGrabber);
            _BGDisplay.transform.localScale = Vector3.one * 15;

            DontDestroyOnLoad(_BGDisplay.gameObject);

            _BGDisplay.gameObject.SetActive(false);
            //VR.GUI.AddGrabber(new CameraConsumer());
            VR.GUI.AddGrabber(bgGrabber);

            Invoke(() => OnLevel(SceneManager.GetActiveScene().buildIndex), 0.1f);
        }
コード例 #2
0
ファイル: OneHandedMode.cs プロジェクト: Eusth/IOVR
        protected override void OnStart()
        {
            base.OnStart();

            _GUI = GUIQuad.Create();
            _GUI.transform.parent     = VR.Camera.Origin;
            _GUI.transform.localScale = Vector3.one * .3f;
            _GUI.IsOwned = true;

            _GUI.gameObject.SetActive(false);
        }
コード例 #3
0
        protected override void OnAwake()
        {
            base.OnAwake();

            Gui = GUIQuad.Create();
            Gui.transform.parent        = transform;
            Gui.transform.localScale    = Vector3.one * .3f;
            Gui.transform.localPosition = new Vector3(0, 0.05f, -0.06f);
            Gui.transform.localRotation = Quaternion.Euler(90, 0, 0);
            Gui.IsOwned = true;
            DontDestroyOnLoad(Gui.gameObject);
        }
コード例 #4
0
        private void OnStartPinch()
        {
            _Pinching = true;

            if (_Current)
            {
                DestroyImmediate(_Current.gameObject);
            }
            _Current = GUIQuad.Create();
            _Current.transform.SetParent(VR.Camera.Origin, false);
            DontDestroyOnLoad(_Current);
            _Current.transform.position    = Vector3.Lerp(VR.Mode.LeftHand.PinchPoint.position, VR.Mode.RightHand.PinchPoint.position, 0.5f);
            _Current.transform.rotation    = Quaternion.Slerp(VR.Mode.LeftHand.PinchPoint.rotation, VR.Mode.RightHand.PinchPoint.rotation, 0.5f) * Quaternion.Euler(0, 0, 90);
            _Current.transform.localScale *= Vector3.Distance(VR.Mode.LeftHand.PinchPoint.position, VR.Mode.RightHand.PinchPoint.position);

            _Scaler = new GuiScaler(_Current, VR.Mode.LeftHand.PinchPoint, VR.Mode.RightHand.PinchPoint);
        }
コード例 #5
0
        protected override void OnStart()
        {
            base.OnStart();

            try
            {
                VRLog.Debug("Loading GripMoveTool", new object[0]);
                _settings   = (VR.Manager.Context.Settings as KKCharaStudioVRSettings);
                internalGui = GUIQuad.Create(null);
                resetGUIPosition();
                internalGui.gameObject.AddComponent <MoveableGUIObject>();
                internalGui.gameObject.AddComponent <BoxCollider>();
                internalGui.IsOwned = true;
                DontDestroyOnLoad(internalGui.gameObject);
                CreatePointer();
                gripMenuHandler         = gameObject.AddComponent <GripMenuHandler>();
                gripMenuHandler.enabled = false;
            }
            catch (Exception ex)
            {
                VRLog.Debug(ex);
            }

            if (marker == null)
            {
                marker = new GameObject("__GripMoveMarker__");
                marker.transform.parent   = transform.parent;
                marker.transform.position = transform.position;
                marker.transform.rotation = transform.rotation;
            }

            if (_settings != null)
            {
                moveSelfButton     = EVRButtonId.k_EButton_Grip;
                moveSelfButtonName = "rgrip";
                grabScreenButton   = EVRButtonId.k_EButton_Axis1;
            }

            menuHandlder = GetComponent <MenuHandler>();
            ikTool       = IKTool.instance;
        }
コード例 #6
0
ファイル: AGHInterpreter.cs プロジェクト: davidanger/AGHVR
        //public override bool IsBody(Collider collider)
        //{
        //    VRLog.Info("Is Body? {0} {1}", collider.name, LayerMask.LayerToName(collider.gameObject.layer));
        //    return collider.gameObject.layer > 0;
        //}

        protected override void OnStart()
        {
            base.OnStart();
            var bgGrabber = new ScreenGrabber(1280, 720, ScreenGrabber.FromList(
                                                  "Camera_BG",     // backgrounds
                                                  "Camera_Main",   // no idea
                                                  "Camera_Effect", // effects (e.g. vignette?)
                                                  "Camera"         // cinematics
                                                  ));

            _BGDisplay = GUIQuad.Create(bgGrabber);
            _BGDisplay.transform.localScale = Vector3.one * 15;

            DontDestroyOnLoad(_BGDisplay.gameObject);

            _BGDisplay.gameObject.SetActive(false);
            //VR.GUI.AddGrabber(new CameraConsumer());
            VR.GUI.AddGrabber(bgGrabber);

            Invoke(() => OnLevel(SceneManager.GetActiveScene().buildIndex), 0.1f);
        }