Esempio n. 1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.layer == LayerMask.NameToLayer("Player") || other.gameObject.layer == LayerMask.NameToLayer("PlayerImmunity"))
        {
            Time.timeScale = 0f;

            if (GameManager.Exist())
            {
                if (GameManager.instance.GetLevelsManager().GetMode())
                {
                    OptionsManager     optionsMng     = GameManager.instance.GetOptionsManager();
                    SpeedrunManager    speedRunMng    = LevelManager.instance.GetSpeedrunManager();
                    dreamloLeaderBoard leaderBoardMng = GameManager.instance.GetLeaderboard();
                    leaderBoardMng.AddScore(optionsMng.GetUserName(), speedRunMng.GetTimer());
                }

                GameManager.instance.GetSoundManager().StopMusic();
            }
            PlayerInputManager.SetCanReadInput(false);
            LevelManager.instance.GetUIGameplayManager().ToggleMenu(MenuType.EndGame);

            LevelManager.OnPlayerEndLevel?.Invoke();
            soundCtrl.PlayClip();
        }
    }
Esempio n. 2
0
    private IEnumerator NormalBehaviour()
    {
        bool playerAggro = false;

        while (true)
        {
            Transform _target = viewCtrl.FindPlayer();

            if (_target != null && viewCtrl.CanSeePlayer(_target.position))
            {
                AggroBehaviour(_target);

                if (!playerAggro)
                {
                    playerAggro = true;
                    soundCtrl.PlayClip();
                }
            }
            else
            {
                if (playerAggro)
                {
                    playerAggro = false;
                }
            }

            yield return(null);
        }
    }
Esempio n. 3
0
    private IEnumerator PickupRoutine()
    {
        graphic.SetActive(false);
        sfxCtrl.PlayClip();
        yield return(new WaitForSeconds(1f));

        graphic.SetActive(true);
        gameObject.SetActive(false);
    }
Esempio n. 4
0
    private IEnumerator ShotAnimation()
    {
        sfxCtrl.PlayClip();
        ejectParticle.Play();
        anim.SetTrigger("Eject");
        yield return(new WaitForSeconds(0.20f));

        SetObjectState(false);
        StartCoroutine(Respawn());
    }
Esempio n. 5
0
    private IEnumerator FallCoroutine()
    {
        soundCtrl.PlayClip();
        Vector3 shakeStrenght = Vector3.zero;

        shakeStrenght.x = 0.6f;
        yield return(new WaitForSeconds(fallTime - shakeTime));

        IEnumerator emissionRoutine = ChangeEmission();

        StartCoroutine(emissionRoutine);
        yield return(graphic.transform.DOShakePosition(shakeTime, shakeStrenght, 150).WaitForCompletion());

        StopCoroutine(emissionRoutine);
        yield return(transform.DOMoveY(transform.position.y - 5f, fallSpeed).SetSpeedBased().SetEase(Ease.Linear).WaitForCompletion());

        renderer.material.SetColor("_EmissiveColor", new Color(maxbrightness, maxbrightness, maxbrightness, 1f));
        collider.enabled = false;
        graphic.SetActive(false);
        respawnCoroutine = StartCoroutine(CRespawn());
    }
Esempio n. 6
0
 public void StartEffect()
 {
     soundCtrl.PlayClip();
     anim.SetBool("Crawling", true);
     poopParticle.Play();
 }
Esempio n. 7
0
 public override void Enable()
 {
     animMng.Enable(true);
     soundCtrl.PlayClip();
 }