// 创建命令 public T newCmd <T>(bool show = true, bool delay = false) where T : Command, new() { T cmd = mCommandPool.newCmd <T>(show, delay); #if UNITY_EDITOR if (mTraceCommand) { int line = 0; string file = ""; int frame = 2; while (true) { file = UnityUtility.getCurSourceFileName(frame); line = UnityUtility.getLineNum(frame); if (!file.EndsWith("LayoutTools.cs")) { break; } ++frame; } cmd.mLine = line; cmd.mFile = file; } #endif return(cmd); }
// 创建命令 public Command newCmd(Type type, bool show = true, bool delay = false) { // 如果命令系统已经销毁了,则不能再创建命令 if (mDestroy) { return(null); } Command cmd = mCommandPool.newCmd(type, show, delay); #if UNITY_EDITOR if (mTraceCommand) { int line = 0; string file = null; int frame = 2; while (true) { file = getCurSourceFileName(frame); line = getLineNum(frame); if (!file.EndsWith("LayoutTools.cs")) { break; } ++frame; } cmd.mLine = line; cmd.mFile = file; } #endif return(cmd); }
// 创建命令 public T newCmd <T>(bool show = true, bool delay = false) where T : Command, new() { return(mCommandPool.newCmd <T>(show, delay)); }