Пример #1
0
    IEnumerator Death()
    {
        PostProcessControl.PostExposureFade(-10, .01f);
        yield return(new WaitForSeconds(2f));

        GameManager.NextScene();
    }
Пример #2
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.layer == 21)
        {
            if (health > 0)
            {
                if (_timeUntilNextHitCounter == _timeUntilNextHit)
                {
                    PlaySound.PlayAudioFromSelection(_audioSource, _hitClips, true, -.15f, .15f);
                    //HeartBeatControl.HeartBeatPitchAmount(1.2f);
                    //print(other.gameObject.name);
                    _timeUntilNextHitCounter = 0;
                    //GlobalLowPassFilter.LowPassFilterAmount(500);
                    PostProcessControl.PlayerDamagePostEffect(_playerDamageVignetteAmnt, _playerDamageContrastAmnt);
                    _heartBeatPitch += .1f;
                    HeartBeatControl.HeartBeatPitchAmount(_heartBeatPitch);
                    StartCoroutine(HitHaptics(.25f));
                    //HapticFeedback.HapticAmount(1500, true, true);
                    health--;
                }

                if (health <= 1)
                {
                    //
                }
            }
            else
            {
                StartCoroutine(Death());
            }
        }
    }
Пример #3
0
    public static IEnumerator GameFadeIn()
    {
        GlobalAudio.GlobalAudioFadeIn();

        yield return(new WaitForSeconds(.05f));

        //DeacivateIntro();
        PostProcessControl.OpeningFadeEffect(-10, 0, .02f);
    }
Пример #4
0
    public static IEnumerator StartLogo()
    {
        yield return(new WaitForSeconds(_logoSceneTimer));

        PostProcessControl.OpeningFadeEffect(0, -10f, .025f);
        GlobalAudio.GlobalAudioFadeOut();
        yield return(new WaitForSeconds(2f));

        _sceneToLoad.SetActive(true);
    }
Пример #5
0
    public static IEnumerator MoveToIntroScene()
    {
        PostProcessControl.PostExposureFade(-10, .025f);
        GlobalAudio.GlobalAudioFadeOut();
        yield return(new WaitForSeconds(1.5f));

        //DeacivateIntro();
        //PostProcessControl.PostExposureFade(-10, 0, .025f);
        //_escapeHouseText.SetActive(true);
        _sceneToLoad.SetActive(true);
    }
    public void CloseInventory()
    {
        PostProcessControl.PostExposureFade(_exposureInventoryOff, _exposureFadeSpeed);
        //PostProcessControl.DOFFade(_focalLengthInventoryOff, _focusDistanceInventoryOff, _focalLengthFadeSpeed, _focusDistanceFadeSpeed);

        //print("closing inventory");
        _isInventoryOpen = false;
        _inventoryObj.SetActive(false);
        PlaceItemsInInventory(true, false);
        //ShowInventoryItems(false);
        _firstPressUp = false;
    }
Пример #7
0
    public static IEnumerator StartIntro()
    {
        //print("calling start intro co routine");
        _introEnvironment.SetActive(true);
        yield return(new WaitForSeconds(_introSceneTimer));

        PostProcessControl.OpeningFadeEffect(0, -10, .01f);
        GlobalAudio.GlobalAudioFadeOut();
        yield return(new WaitForSeconds(3f));

        _sceneToLoad.SetActive(true);
        //DeacivateIntro();
    }
    void Update()
    {
        //if (_trackedObj.gameObject.activeInHierarchy)
        //{
        //    _device = SteamVR_Controller.Input((int)_trackedObj.index);
        //}

        if (PlayerScript._deviceDominant.GetPressDown(SteamVR_Controller.ButtonMask.Touchpad) && !_isInventoryOpen)
        {
            _isInventoryOpen = true;
            //CheckInventoryItemPlacement();
            _inventoryObj.SetActive(true);
            //ShowInventoryItems(true);
            PostProcessControl.PostExposureFade(_exposureInventoryOn, _exposureFadeSpeed);
            //PostProcessControl.DOFFade(_focalLengthInventoryOn, _focusDistanceInventoryOn, _focalLengthFadeSpeed, _focusDistanceFadeSpeed);
            HapticFeedback.HapticAmount(500, true, false);
            PlaceItemsInInventory(false, true);
            CheckHandModelVisibility();
            //_handModelObj.gameObject.SetActive(true);

            //if (_inHandObj != null)
            //{
            //    _inHandObj.SetActive(false);
            //    _hasItemInHand = false;
            //}
        }

        if (_isInventoryOpen)
        {
            OpenInventory();
        }

        //if (_hasItemInHand)
        //{
        //    _inHandObj.transform.position = Vector3.Lerp(_inHandObj.transform.position, transform.position, Time.deltaTime * 12f);
        //    _inHandObj.transform.rotation = Quaternion.Slerp(_inHandObj.transform.rotation, transform.rotation, Time.deltaTime * 12f);
        //} else
        //{
        //    foreach (var slot in _inventorySlots)
        //    {
        //        if (slot.hasItemInHand)
        //        {
        //            PutInInventory(slot);
        //        }
        //    }
        //}
    }