Hark-the-Moon-Men-Cometh / Assets / Scripts / Weapons / Player_Unarmed.cs
Player_Unarmed.cs
Raw
using System.Collections;
using UnityEngine;

public class Player_Unarmed : PlayerWeapon
{
    public override void Attack()
    {
        base.Attack();
        r_owner.SetPlayerImmobile(true);
        r_owner.r_animator.SetInteger("Weapon Animation ID", Random.Range(0, 4));
        r_owner.r_animator.SetTrigger("Attack");
    }

    public override void SetIsAttacking(bool attacking)
    {
        base.SetIsAttacking(attacking);
        if (!attacking)
        {
            r_owner.SetPlayerImmobile(false);
        }
    }

    public override void SecondaryHeld()
    {
        //throw new System.NotImplementedException();
    }

    public override void SecondaryReleased()
    {
        //throw new System.NotImplementedException();
    }
    public override void Reload() { }

    private IEnumerator TimeAttack(float duration)
    {
        m_isAttacking = true;
        float timer = 0f;
        while (timer < duration)
        {
            timer += Time.deltaTime;
            yield return null;
        }
        m_isAttacking = false;
    }
}