Using UnityEngine; (2)
Using UnityEngine; (2)
void Start()
{
animator = GetComponent<Animator>();
}
void Update()
{
timeSinceLastPress += Time.deltaTime;
if (Input.GetButtonDown("Fire1"))
{
ExecuteCombo();
}
void ExecuteCombo()
{
if (timeSinceLastPress < comboWindow)
{
currentComboStep++;
}
else
{
currentComboStep = 1;
}
PerformAttack(currentComboStep - 1);
timeSinceLastPress = 0f;
isComboActive = true;
}