コード例 #1
0
 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>();
 }
コード例 #2
0
 private void SetHeadsetFade()
 {
     if (hf == null)
     {
         hf = GetComponent <VRTK_HeadsetFade>();
     }
 }
コード例 #3
0
    private void Awake()
    {
        Debug.Log("Created Gamemanager");
        ChangeState((GameStates)SceneManager.GetActiveScene().buildIndex);

        headsetFade = gameObject.AddComponent <VRTK_HeadsetFade>();

        FinishedSetup = true;
    }
コード例 #4
0
    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());
    }
コード例 #5
0
ファイル: MenuOrb.cs プロジェクト: qdoyonnas/Incantorium
    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);
    }
コード例 #6
0
ファイル: GameController.cs プロジェクト: tejpratap0/Unity
    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));
    }
コード例 #7
0
    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);
        }
    }
コード例 #8
0
 /// <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));
 }
コード例 #9
0
 // Use this for initialization
 void Start()
 {
     headsetFade = GetComponent <VRTK_HeadsetFade>();
     fadeCount   = 0;
 }