Newer
Older
TheVengeance-Project-IADE-Unity2D / Assets / Scripts / NPC / BlackSmith / Actions / GreetAction.cs
@Rackday Rackday on 29 Oct 656 bytes Major Update
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using MyCollections.AI.FinitStateMachine;
  5. [CreateAssetMenu(menuName = "Finite State Machine/Action/Greet")]
  6. public class GreetAction : Action
  7. {
  8. public override void Run(FSM fsm)
  9. {
  10. Blacksmith controller = (Blacksmith)fsm.Controller;
  11. if (controller != null)
  12. {
  13. Vector2 dir = controller.AgentFOV.TargetDirection;
  14. controller.Animator.SetTrigger("Greet");
  15. controller.Agent.agentStop = true;
  16. controller.Agent.destination = Vector2.zero;
  17. controller.hasGreetPlayer = true;
  18. }
  19. }
  20. }