Exemplo n.º 1
0
    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);
    }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 //Adds an action to all queued actions for the turn
 public void AddActionToQueue(Action_Base _action)
 {
     ActionList.Add(_action);
 }
Exemplo n.º 4
0
 public void ActionEnd(Action_Base action)
 {
     currentAction = null;
     AnimtionUpdate();
 }