Пример #1
0
        void Start()
        {
            camRig = FindObjectOfType <OVRCameraRig>();

            particles     = eventSource.GetComponentInChildren <ParticleSystem>();
            cameraCollide = camRig.GetComponent <Collider>();

            teleporterSound = this.gameObject.GetComponent <AudioSource>();
        }
Пример #2
0
 // ---- CLIENT ----
 private void SetUpLocalPlayer()
 {
     // set OVR camera to networkplayer position
     ovr = FindObjectOfType <OVRCameraRig>();
     if (ovr != null)
     {
         ovr.transform.position = new Vector3(transform.position.x, 0, transform.position.z);
         ovr.transform.parent   = transform;
         vrHead = ovr.GetComponent <GearVRHead>();
     }
     SetUpLocalFeet();
     //SetUpAvatar();
 }
Пример #3
0
    private IEnumerator TeleportToStart()
    {
        yield return(new WaitForSecondsRealtime(2.0f));

        OVRCameraRig  rig = FindObjectOfType <OVRCameraRig>();
        OVRScreenFade _screenFadeScript = rig.GetComponent <OVRScreenFade>();

        if (_screenFadeScript != null)
        {
            _screenFadeScript.OnLevelFinishedLoading(0);
        }

        Debug.Log($"[OneCellClass] Teleport player back at start. Time = {Time.fixedTime - TheCellGameMgr.instance.GetGameStartTime()}");
        TheCellGameMgr.instance.TeleportToStart();
    }
Пример #4
0
    bool TriggerAction()
    {
        // Do whatever you need to do when trap is opening
        Debug.Log($"Exit trap is open now = {transform.position} at {Time.fixedTime}");

        OVRCameraRig  rig = FindObjectOfType <OVRCameraRig>();
        OVRScreenFade _screenFadeScript = rig.GetComponent <OVRScreenFade>();

        if (_screenFadeScript != null)
        {
            //_screenFadeScript.SetFadeLevel(fadeLevel * MaxFade);
            _screenFadeScript.FadeOut();
        }

        return(true);
    }
Пример #5
0
    private void Awake()
    {
        activePath = androidPath;
        var cameras    = ovrCameraRig.GetComponentsInChildren <Camera>();
        var cameraList = new List <Camera>(cameras);

        activeCamera = cameraList.FirstOrDefault(c => c.enabled);

#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
        activePath   = windowsPath;
        activeCamera = desktopCameraRig.GetComponentInChildren <Camera>();
#endif

        VRCameraManager = ovrCameraRig.GetComponent <OVRManager>();
        player.Events.AddListener(OnVideoEvent);
    }
Пример #6
0
    private IEnumerator DelayedDeath()
    {
        AudioSource snd = TheCellGameMgr.instance.Audio_DeathScream[0];

        snd.Play();

        yield return(new WaitForSecondsRealtime(3.0f));

        Debug.Log($"[OneCellClass] Kill the player sub {cellSubType}, go back at start. DeathTime = {Time.fixedTime - TheCellGameMgr.instance.GetGameStartTime()}");

        OVRCameraRig  rig = FindObjectOfType <OVRCameraRig>();
        OVRScreenFade _screenFadeScript = rig.GetComponent <OVRScreenFade>();

        if (_screenFadeScript != null)
        {
            _screenFadeScript.fadeColor = new Color(0.5f, 0.0f, 0.0f);
            _screenFadeScript.FadeOut();
        }

        StartCoroutine(TeleportToStart());
    }