IndieGame/client/Assets/Ether/Editor/Templete/TempTools.cs

24 lines
725 B
C#
Raw Normal View History

2024-10-24 23:44:04 +08:00

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Ether
{
public static class TempTools
{
/// <summary>
/// 生成类
/// </summary>
public static void GenerateClass(string className, string baseClassName, string content, string generatePath)
{
string tempClassStr = FileTools.ReadFile(PathTools.TempClassPath);
tempClassStr = tempClassStr.Replace("$ClassName$", className);
tempClassStr = tempClassStr.Replace("$BaseClassName$", baseClassName);
tempClassStr = tempClassStr.Replace("$Content$", content);
FileTools.WriteFile(generatePath, tempClassStr);
}
}
}