public bool StartAction(GameObject actionPrefab) { int priority = actionPrefab.GetComponent <Action_Base>().priority; if ((CanAction() || priority > 20) && (currentAction == null || priority > currentAction.priority)) { GameObject g = Instantiate(actionPrefab); Action_Base action = g.GetComponent <Action_Base>(); if (currentAction != null) { currentAction.OnActionEnd(); } currentAction = action; action.OnActionStart(this); string an = g.GetComponent <Action_Base>().AnimationName; if (an != "") { animator.Play(an); } return(true); } return(false); }
public void EndAction() { UI_Manager.UIManager.UI_Close("UI_Battle_Action"); UI_Manager.UIManager.UI_Close("UI_Battle_CharacterBaseInfo"); MouseController.mouse.state = MouseController.EMouseState.MOUSESTATE_NONE; GameSystem.game.clicked = null; action = null; }
//Adds an action to all queued actions for the turn public void AddActionToQueue(Action_Base _action) { ActionList.Add(_action); }
public void ActionEnd(Action_Base action) { currentAction = null; AnimtionUpdate(); }