Newer
Older
TheVengeance-Project-IADE-Unity2D / Assets / Scripts / NPC / Orc / Actions / DisableWeaponAction.cs
@Rackday Rackday on 3 Sep 514 bytes Minor Update
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MyCollections.AI.FinitStateMachine;

[CreateAssetMenu(menuName = "Finite State Machine/Action/DisableWeaponAction")]
public class DisableWeaponAction : Action
{
    public override void Run(FSM fsm)
    {
        OrcNPCController controller = (OrcNPCController)fsm.Controller;
        GameObject weapon = controller.Weapon;

        fsm.Controller.Animator.SetBool("IsAttacking", false);
        weapon.SetActive(false);
    }
}