// Add an action to the list and start it if is the only action public void AddAction(UnitAction action) { actions.Add(action); if (actions.Count == 1) { action.StartAction(); } }
public virtual bool StartAction (UnitAction _action) { if (action != null) { if (!action.isactive) { action = _action; action.StartAction(); return true; } else if (_action.priory > action.priory) { if (InterruptAction()) { action = _action; action.StartAction(); return true; } } } else { action = _action; action.StartAction(); return true; } return false; }