public static MonoCommand ExecuteOn(Type type, GameObject target, object[] args) { MonoCommand result = (MonoCommand)target.AddComponent(type); result._args = args; result.Scope = CommandScope.GameObject; return(result); }
public StateCommand Execute(Type type, params object[] args) { StateCommand command = (StateCommand)MonoCommand.ExecuteOn(type, _container.GameObject, args); _commands.Add(command); command.AsyncToken.AddResponder(new Responder <StateCommand>(delegate(StateCommand result) { _commands.Remove(result); })); return(command); }
public T Execute <T>(params object[] args) where T : StateCommand, new() { T command = MonoCommand.ExecuteOn <T>(_container.GameObject, args); _commands.Add(command); command.AsyncToken.AddResponder(new Responder <StateCommand>(delegate(StateCommand result) { _commands.Remove(result); }, delegate(StateCommand result) { _commands.Remove(result); } )); return(command); }
public virtual void OnCommandStart(MonoCommand command, object[] args) { }
private StateCommand CreateState(Type type, object[] args) { return((StateCommand)MonoCommand.ExecuteOn(type, _container.GameObject, args)); }