// 创建命令 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 (mSystemDestroy) { return(null); } Command cmd = mCommandPool.newCmd(type, 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 void waitForUnlock() { while (Interlocked.Exchange(ref mLockCount, 1) != 0) { } if (mTraceStack) { mFileName = UnityUtility.getCurSourceFileName(2); mLine = UnityUtility.getLineNum(2); } }