void Start() { boxDetected = false; if (GameObject.Find("FloatingBox") != null) { floatingBox = GameObject.Find("FloatingBox").GetComponent <BoxFloat>(); } LeftController = GameObject.Find("LeftController"); RightController = GameObject.Find("RightController"); touchedWater = false; oxygenTimer = 60f; waterRises = false; headIsUnderWater = false; reachedTopPuzzle = false; notDrownedYet = true; headSet = GameObject.Find("[VRTK_SDKManager]").transform.GetChild(0).GetChild(0).GetChild(0).gameObject; headsetbody = null; feet = null; head = null; ropeCheck = true; fader = GameObject.Find("PlayArea").GetComponent <VRTK_HeadsetFade>(); if (transform.Find("UnderwaterAmbience1") != null) { UnderwaterAmbience1 = transform.Find("UnderwaterAmbience1").GetComponent <AudioSource>(); UnderwaterAmbience2 = transform.Find("UnderwaterAmbience2").GetComponent <AudioSource>(); UnderwaterAmbience3 = transform.Find("UnderwaterAmbience3").GetComponent <AudioSource>(); UnderwaterAmbience4 = transform.Find("UnderwaterAmbience4").GetComponent <AudioSource>(); } //UnderWaterHeadLight = headSet.transform.GetChild(2).GetChild(2).GetComponent<Light>(); //sManager = GameObject.Find("[VRTK_SDKManager]").GetComponent<VRTK_SDKManager>(); }
private void SetHeadsetFade() { if (hf == null) { hf = GetComponent <VRTK_HeadsetFade>(); } }
private void Awake() { Debug.Log("Created Gamemanager"); ChangeState((GameStates)SceneManager.GetActiveScene().buildIndex); headsetFade = gameObject.AddComponent <VRTK_HeadsetFade>(); FinishedSetup = true; }
void Start() { // Grab our fader. fadeReference = this.GetComponent <VRTK_HeadsetFade> (); // Since this'll get called on a new scene, let's fade in. // Have to do this in a "return 0 coroutine" because Unity. StartCoroutine(WaitFrameThenUnfade()); }
private void Start() { hover = GetComponent <HoverInPlace>(); interactable = GetComponent <VRTK_InteractableObject>(); glowEffect = transform.Find("GlowEffect").gameObject; glowLight = GetComponentInChildren <Light>(); headsetFade = (VRTKScripts.instance == null ? null : VRTKScripts.instance.GetComponentInChildren <VRTK_HeadsetFade>()); isAnchored = transform.position == anchor.position; SetHover(isAnchored); }
IEnumerator switchScene(string sceneName) { VRTK_HeadsetFade headsetFade = gameObject.GetComponentInChildren <VRTK_HeadsetFade>(); headsetFade.Fade(Color.black, Constants.FadeSpeed); yield return(new WaitForSeconds(Constants.FadeSpeed)); Debug.Log("Loading Scene " + sceneName + "..."); yield return(SceneManager.LoadSceneAsync(sceneName)); Debug.Log("Loading Scene Done" + "..."); headsetFade.Unfade(Constants.FadeSpeed); yield return(new WaitForSeconds(Constants.FadeSpeed)); }
private void Start() { VRTK_HeadsetFade fade = VRTKScripts.instance.GetComponentInChildren <VRTK_HeadsetFade>(); if (fade != null) { fade.Fade(Color.black, 0); } Transform playArea = VRTK_DeviceFinder.PlayAreaTransform(); playArea.position = this.transform.position; playArea.rotation = this.transform.rotation; OnStart(); if (fade != null) { fade.Unfade(0.5f); } }
/// <summary> /// Observable HeadsetUnfadeComplete event /// </summary> /// <param name="events"></param> /// <returns></returns> public static IObservable <HeadsetFadeEventArgs> HeadsetUnfadeCompleteAsObservable(this VRTK_HeadsetFade events) { return(Observable.FromEvent <HeadsetFadeEventHandler, HeadsetFadeEventArgs>( h => (s, e) => h(e), h => events.HeadsetUnfadeComplete += h, h => events.HeadsetUnfadeComplete -= h)); }
// Use this for initialization void Start() { headsetFade = GetComponent <VRTK_HeadsetFade>(); fadeCount = 0; }