public virtual void OnEnable() { smooth = (VRSmooth)target; if (smooth.GetComponent <VRInteractor>() == null) { smooth.gameObject.AddComponent <VRInteractor>(); EditorUtility.SetDirty(smooth); EditorSceneManager.MarkSceneDirty(SceneManager.GetActiveScene()); } }
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; } }