コード例 #1
0
ファイル: GameDebug.cs プロジェクト: trazd66/PJddd
        static void InternalLog(WorldId worldId, ConfigVar configVar, string message)
        {
            var msg = message;

            if (configVar != null)
            {
                var configColor = GetColorStringFromHash((uint)configVar.name.GetHashCode());
                msg = "<color=#" + configColor + "><" + configVar.name + "></color>" + msg;
            }


            if (worldId != WorldId.Undefined)
            {
                var world      = WorldId.FindWorld(worldId);
                var hash       = MathHelper.hash(worldId);
                var worldColor = GetColorStringFromHash(hash);
                msg = "<color=#" + worldColor + "><" + world?.Name + "></color>" + msg;
            }
            else
            {
                msg = "<NOWORLD>" + msg;
            }

            if (forwardToDebug)
            {
                Debug.Log(s_frameCount + ": " + msg);
            }
            else
            {
                _Log(msg);
            }
        }
コード例 #2
0
ファイル: GameDebug.cs プロジェクト: trazd66/PJddd
        public static void Log <T1, T2, T3, T4, T5, T6, T7>(WorldId worldId, ConfigVar configVar, string format, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7)
        {
            if (configVar != null && configVar.IntValue == 0)
            {
                return;
            }

            InternalLog(worldId, configVar, string.Format(format.ToString(), arg1, arg2, arg3, arg4, arg5, arg6, arg7));
        }
コード例 #3
0
ファイル: GameDebug.cs プロジェクト: trazd66/PJddd
        public static void Log <T1, T2, T3>(WorldId worldId, ConfigVar configVar, string format, T1 arg1, T2 arg2, T3 arg3)
        {
            if (configVar != null && configVar.IntValue == 0)
            {
                return;
            }

            InternalLog(worldId, configVar, string.Format(format.ToString(), arg1, arg2, arg3));
        }
コード例 #4
0
ファイル: GameDebug.cs プロジェクト: trazd66/PJddd
        public static void Log(WorldId worldId, ConfigVar configVar, string message)
        {
            if (configVar != null && configVar.IntValue == 0)
            {
                return;
            }

            InternalLog(worldId, configVar, message.ToString());
        }
コード例 #5
0
ファイル: GameDebug.cs プロジェクト: trazd66/PJddd
        public static World FindWorld(WorldId worldId)
        {
            for (int i = 0; i < World.All.Count; i++)
            {
                if (worldId == (WorldId)World.All[i])
                {
                    return(World.All[i]);
                }
            }

            return(null);
        }