Пример #1
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            LaserInputModule _target = (LaserInputModule)target;

            if (_target.pointer == Pointer.Eye)
            {
                _target.gazeTimeInSeconds  = EditorGUILayout.FloatField("Gaze Time In Seconds", _target.gazeTimeInSeconds);
                _target.delayTimeInSeconds = EditorGUILayout.FloatField("Delay Time In Seconds", _target.delayTimeInSeconds);
            }

            if (GUILayout.Button("Setup Input Module"))
            {
                switch (_target.platform)
                {
                case VRPlatform.OCULUS:
                    SetPlatformCustomDefine("UIKIT_OCULUS");
                    break;

                case VRPlatform.VIVE:
                    SetPlatformCustomDefine("UIKIT_VIVE");
                    break;

                case VRPlatform.VIVE_STEAM2:
                    SetPlatformCustomDefine("UIKIT_VIVE_STEAM_2");
                    break;

                case VRPlatform.NONE:
                    SetPlatformCustomDefine("");
                    break;
                }
            }
        }
Пример #2
0
        public OculusLaserInputDirect(ref GameObject gameObject, out LaserInputModule laserInputModule)
        {
            var temppp = YUR.SDK.Unity.YUR.Yur.YURAssetBundle.LoadAsset <GameObject>("LaserInputModuleSteam2");


            gameObject = UnityEngine.Object.Instantiate(temppp);

            //laserInputModule = gameObject.AddComponent<VRUiKits.Utils.OculusLaserInputModule>();
        }
Пример #3
0
        float pressedDistance;  // Distance the laser travelled while pressed.

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

            // Check if instance already exists
            if (_instance == null)
            {
                //if not, set instance to this
                _instance = this;
            }
            //If instance already exists and it's not this:
            else if (_instance != this)
            {
                Debug.LogWarning("Trying to instantiate multiple UIKitLaserInputModule.");
                Destroy(gameObject);
            }
        }
Пример #4
0
        public float pressedDistance;  // Distance the laser travelled while pressed.

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


            if (_instance != null)
            {
                Debug.LogWarning("Trying to instantiate multiple UIKitLaserInputModule.");
                DestroyImmediate(this.gameObject);
            }

            _instance = this;

            //if (platform == VRPlatform.OCULUS && OculusLaserInputModule.instance == null)
            //    _instance = gameObject.AddComponent<OculusLaserInputModule>();
            //else if (platform == VRPlatform.VIVE_STEAM2 && Steam2LaserInputModule.instance == null)
            //    _instance = gameObject.AddComponent<Steam2LaserInputModule>();
        }
Пример #5
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            LaserInputModule _target = (LaserInputModule)target;

            if (_target.pointer == Pointer.Eye)
            {
                _target.gazeTimeInSeconds  = EditorGUILayout.FloatField("Gaze Time In Seconds", _target.gazeTimeInSeconds);
                _target.delayTimeInSeconds = EditorGUILayout.FloatField("Delay Time In Seconds", _target.delayTimeInSeconds);
            }

            if (GUILayout.Button("Setup Input Module"))
            {
                switch (_target.platform)
                {
                case VRPlatform.OCULUS:
                    SetPlatformCustomDefine("UIKIT_OCULUS");
                    break;

                case VRPlatform.VIVE:
                    SetPlatformCustomDefine("UIKIT_VIVE");
                    break;

                case VRPlatform.VIVE_STEAM2:
                    SetPlatformCustomDefine("UIKIT_VIVE_STEAM_2");
                    break;

                case VRPlatform.NONE:
                    SetPlatformCustomDefine("");
                    break;
                }
            }

#if UIKIT_VIVE_STEAM_2
            if (_target.setupHmdExplicitly)
            {
                _target.m_leftHand  = EditorGUILayout.ObjectField("Left Hand", _target.m_leftHand, typeof(Transform), true) as Transform;
                _target.m_rightHand = EditorGUILayout.ObjectField("Right Hand", _target.m_rightHand, typeof(Transform), true) as Transform;
                _target.m_centerEye = EditorGUILayout.ObjectField("Center Eye", _target.m_centerEye, typeof(Transform), true) as Transform;
            }
#endif
        }
Пример #6
0
 public OculusLaserInputDirect(ref GameObject gameObject, out LaserInputModule laserInputModule)
 {
     laserInputModule = gameObject.AddComponent <VRUiKits.Utils.OculusLaserInputModule>();
 }