internal void InitCommand(int totalCommand, CommandExecute onCommandRegistComplete, StepComplete onStepComplete, UserError onUserError, RegistCommandList onAllCommandRegisted) { this.totalCommand = totalCommand; this.onStepComplete = onStepComplete; this.onUserError = onUserError; this.commandExecute = onCommandRegistComplete; this.onAllCommandRegisted = onAllCommandRegisted; TryComplelteRegist(); }
/// <summary> /// 设置安装顺序并生成最终步骤 /// </summary> public void LunchActionSystem <T>(T[] steps, UnityAction <T[]> onLunchOK) where T : IActionStap { Debug.Assert(steps != null); onCommandRegisted = (activeCommands) => { var stepsWorp = ConfigSteps <T>(activeCommands, steps);//重新计算步骤 activeCommands = GetIActionCommandList(activeCommands, Array.ConvertAll <IActionStap, string>(stepsWorp, x => x.StapName)); remoteController = new LineCommandController(activeCommands); onLunchOK.Invoke(Array.ConvertAll <IActionStap, T>(stepsWorp, x => (T)x)); }; if (commandCtrl.CommandRegisted) { onCommandRegisted.Invoke(commandCtrl.CommandList); } }
/// <summary> /// 传入command名称关联字典 /// </summary> /// <param name="rule"></param> public void LunchActionSystem(Dictionary <string, string[]> rule, UnityAction onLunchOK) { onCommandRegisted = (activeCommands) => { var steps = activeCommands.ConvertAll <string>(x => x.StepName); steps.Sort(); activeCommands = GetIActionCommandList(activeCommands, steps.ToArray()); remoteController = new TreeCommandController(rule, activeCommands); onLunchOK.Invoke(); }; if (commandCtrl.CommandRegisted) { onCommandRegisted.Invoke(commandCtrl.CommandList); } }
/// <summary> /// 设置安装顺序并生成最终步骤 /// </summary> public void LunchActionSystem(string[] steps, UnityAction <string[]> onLunchOK) { Debug.Assert(steps != null); onCommandRegisted = (activeCommands) => { var stepsWorp = ConfigSteps(activeCommands, steps);//重新计算步骤 activeCommands = GetIActionCommandList(activeCommands, stepsWorp); remoteController = new LineCommandController(activeCommands); onLunchOK.Invoke(stepsWorp); }; if (commandCtrl.CommandRegisted) { onCommandRegisted.Invoke(commandCtrl.CommandList); } }