diff --git a/Assets/TEngine/Editor/ProtoGenTools/ProtoGenTools.cs b/Assets/TEngine/Editor/ProtoGenTools/ProtoGenTools.cs index ed7049d7..f9a7c809 100644 --- a/Assets/TEngine/Editor/ProtoGenTools/ProtoGenTools.cs +++ b/Assets/TEngine/Editor/ProtoGenTools/ProtoGenTools.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Text; +using UnityEngine; #if UNITY_EDITOR using UnityEditor; #endif @@ -16,7 +17,7 @@ namespace TEngine.Editor public static void Export() { InnerProto2CS.Proto2CS(); - Log.Info("proto2cs succeed!"); + Debug.Log("proto2cs succeed!"); } } @@ -47,10 +48,19 @@ namespace TEngine.Editor string s = File.ReadAllText(proto); StringBuilder sb = new StringBuilder(); + sb.Append("//------------------------------------------------------------------------------\n"); + sb.Append("// \n"); + sb.Append("// This code was generated by a tool.\n"); + sb.Append("// Changes to this file may cause incorrect behavior and will be lost if\n"); + sb.Append("// the code is regenerated.\n"); + sb.Append("// \n"); + sb.Append("//------------------------------------------------------------------------------\n"); + sb.Append("\n"); sb.Append("using System;\n"); sb.Append("using ProtoBuf;\n"); sb.Append("using TEngine;\n"); sb.Append("using System.Collections.Generic;\n"); + sb.Append("\n"); sb.Append($"namespace {nameSpace}\n"); sb.Append("{\n"); @@ -189,7 +199,7 @@ namespace TEngine.Editor { using (StreamWriter sw = new StreamWriter(txt)) { - Log.Debug(sb.ToString()); + Debug.Log(sb.ToString()); sw.Write(sb.ToString()); } }