Esempio n. 1
0
 // 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();
     }
 }
Esempio n. 2
0
		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;
		}