Newer
Older
HardPoint-Project-Abertay-University-Unity3D / Assets / Scripts / FSM / Actions / ResetAttackAction.cs
@Rackday Rackday on 18 Aug 673 bytes Project Added
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu(menuName = "AI/Action/Reset")]

public class ResetAttackAction : Action
{
    public override void Act(FiniteStateMachine fsm)
    {
        if(!fsm.dic.HasKey("rb"))fsm.dic.SetValue("rb", fsm.GetComponent<Rigidbody>());
        fsm.dicBools.SetValue("Attacking", false);
        fsm.dicVecs.DeleteKey("groundPoint");
        (fsm.dic.GetValue("movement") as IMovable).ChangeVelocity((Vector3)fsm.dic.GetValue("KnockBack"));
        (fsm.dic.GetValue("rb") as Rigidbody).useGravity = true;
        
        //fsm.dic.DeleteKey("Knockback");
        Debug.Log("Here");
    }
}