Пример #1
0
    public PlayerGamepad player_pad;      //needed to access the player's movement script.

    public IEnumerator StaggerPlayer()
    {
        //turn off the player movement to simulate a stun.
        player_pad.SetPlayerMovement(false);
        yield return(new WaitForSeconds(stagger_duration));

        //turn on the player movement to end the stun.
        player_pad.SetPlayerMovement(true);
    }
Пример #2
0
    public IEnumerator StaggerPlayer()
    {
        //turn off the player movement to simulate a stun.
        player_pad.SetPlayerMovement(false);
        //create damaged effect
        if (!my_combat.is_countering)
        {
            GameObject effect = Instantiate(damaged_effect, transform.position, transform.rotation);
            Destroy(effect, 1f);
        }
        yield return(new WaitForSeconds(stagger_duration));

        //turn on the player movement to end the stun.
        player_pad.SetPlayerMovement(true);
    }