Professional Documents
Culture Documents
1.4.2
1.4.2
1.4.2
Collections;
using UnityEngine;
using UnityEngine.UI;
void Die()
{
Respawn();
}
if (!dash)
body.velocity = new Vector2(horizontalInput * speed, body.velocity.y);
if (Input.GetKeyDown(KeyCode.I))
{
StartCoroutine(Punch());
audioManager.PlaySFX(audioManager.punchsfx);
}
if (Input.GetKeyDown(KeyCode.O))
{
StartCoroutine(Kick());
audioManager.PlaySFX(audioManager.kicksfx);
}
dash = false;
}
void ResetPosition()
{
transform.position = InitialPosition;
body.velocity = Vector2.zero;
}
void PlayStartAnimation()
{
anim.SetTrigger("Start");
}
void PlayRespawnAnimation()
{
anim.SetTrigger("Start");
}
}