Beispiel #1
0
    public void Dash()
    {
        if (dead || frozen || stunned || inCutscene || currentState.Equals(PlayerStates.SURF))
        {
            return;
        }

        if (dashCooldown)
        {
            earlyDashInput = true;
            Invoke("EndEarlyDashInput", missedInputCooldown);
            return;
        }

        /*
         * if (!grounded && airDashes < 1) {
         *      return;
         * }
         * airDashes--;
         */

        StartCombatStanceCooldown();
        CameraShaker.MedShake();
        anim.SetTrigger("Dash");
    }
	void LandMeteor() {
		inMeteor = false;
		anim.SetBool("InMeteor", false);
		rb2d.velocity = Vector2.zero;
		//if called while wallsliding
		anim.ResetTrigger("Meteor");
		SoundManager.ExplosionSound();
		if (currentEnergy > 0) {
			Instantiate(vaporExplosion, transform.position, Quaternion.identity);
		}
		CameraShaker.MedShake();
	}
    void OnTriggerEnter2D(Collider2D other)
    {
        Rigidbody2D      rb2d             = other.GetComponent <Rigidbody2D>();
        PlayerController playerController = other.GetComponent <PlayerController>();

        if (playerController != null)
        {
            playerController.OnBoost(this);
            animator.SetTrigger("Boost");
            CameraShaker.MedShake();
            for (int i = 0; i < boostSounds.Length; i++)
            {
                SoundManager.PlaySound(boostSounds[i]);
            }
        }
    }