1234567891011121314151617181920212223242526272829303132333435 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using KairoEngine.Core;
- namespace KairoEngine.CharacterSystem
- {
- public class ZombieMoveToPositionCommand : ICommand
- {
- CharacterController character;
- Vector3 targetPosition;
- int varient;
- public ZombieMoveToPositionCommand(CharacterController character, Vector3 targetPosition, int varient)
- {
- this.character = character;
- this.targetPosition = targetPosition;
- this.varient = varient;
- }
- public void Execute()
- {
- ZombieMoveToPositionAction action = new ZombieMoveToPositionAction(character, targetPosition, varient);
- ActionController actionController = character.GetComponent<ActionController>();
- if(actionController.HasAction(action) == false)
- {
- actionController.AddAction(action);
- }
- else
- {
- actionController.ChangeAction(action);
- }
- }
- }
- }
|