mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
Update ProtoGenTools.cs
This commit is contained in:
@@ -2,6 +2,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using UnityEngine;
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
#endif
|
#endif
|
||||||
@@ -16,7 +17,7 @@ namespace TEngine.Editor
|
|||||||
public static void Export()
|
public static void Export()
|
||||||
{
|
{
|
||||||
InnerProto2CS.Proto2CS();
|
InnerProto2CS.Proto2CS();
|
||||||
Log.Info("proto2cs succeed!");
|
Debug.Log("proto2cs succeed!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,10 +48,19 @@ namespace TEngine.Editor
|
|||||||
string s = File.ReadAllText(proto);
|
string s = File.ReadAllText(proto);
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("//------------------------------------------------------------------------------\n");
|
||||||
|
sb.Append("// <auto-generated>\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("// </auto-generated>\n");
|
||||||
|
sb.Append("//------------------------------------------------------------------------------\n");
|
||||||
|
sb.Append("\n");
|
||||||
sb.Append("using System;\n");
|
sb.Append("using System;\n");
|
||||||
sb.Append("using ProtoBuf;\n");
|
sb.Append("using ProtoBuf;\n");
|
||||||
sb.Append("using TEngine;\n");
|
sb.Append("using TEngine;\n");
|
||||||
sb.Append("using System.Collections.Generic;\n");
|
sb.Append("using System.Collections.Generic;\n");
|
||||||
|
sb.Append("\n");
|
||||||
sb.Append($"namespace {nameSpace}\n");
|
sb.Append($"namespace {nameSpace}\n");
|
||||||
sb.Append("{\n");
|
sb.Append("{\n");
|
||||||
|
|
||||||
@@ -189,7 +199,7 @@ namespace TEngine.Editor
|
|||||||
{
|
{
|
||||||
using (StreamWriter sw = new StreamWriter(txt))
|
using (StreamWriter sw = new StreamWriter(txt))
|
||||||
{
|
{
|
||||||
Log.Debug(sb.ToString());
|
Debug.Log(sb.ToString());
|
||||||
sw.Write(sb.ToString());
|
sw.Write(sb.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user