public virtual void OnEnable()
        {
            teleporter = (ArcTeleporter)target;
            if (teleporter.raycastLayer != null)
            {
                raycastLayersSize = teleporter.raycastLayer.Count;
            }
            else
            {
                raycastLayersSize = 0;
            }
            if (teleporter.tags != null)
            {
                tagsSize = teleporter.tags.Count;
            }
            else
            {
                tagsSize = 0;
            }

            input = teleporter.GetComponent <VRInput>();
            if (input == null)
            {
                input = teleporter.gameObject.AddComponent <VRInput>();
                SetDefaultActions();
                EditorUtility.SetDirty(teleporter);
                EditorSceneManager.MarkSceneDirty(SceneManager.GetActiveScene());
            }
        }
Exemple #2
0
        void Start()
        {
            _teleporter = GetComponent <ArcTeleporter>();
            _smooth     = GetComponent <VRSmooth>();
            _interactor = GetComponent <VRInteractor>();
            if (_teleporter == null)
            {
                Debug.LogError("Missing ArcTeleporter", gameObject);
                return;
            }
            if (_smooth == null)
            {
                Debug.LogError("Missing VRSmooth", gameObject);
                return;
            }

            _currentType = (LocoType)PlayerPrefs.GetInt("LocoType", 0);
            if (_teleporter.enabled == _smooth.enabled)
            {
                _teleporter.enabled = _currentType == LocoType.ARCTELEPORTER;
                _smooth.enabled     = _currentType == LocoType.SMOOTH;
            }
        }