Skip to content

Commit

Permalink
添加luban工具集
Browse files Browse the repository at this point in the history
  • Loading branch information
DangoRyn committed Jun 18, 2022
1 parent 9a7add0 commit 999e344
Show file tree
Hide file tree
Showing 413 changed files with 37,409 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ sysinfo.txt
# Crashlytics generated file
crashlytics-build.properties

.idea/
Assets/StreamingAssets/
HuatuoData/
Binary file modified Assets/GameMain/Hotfix/Game.Hotfix.dll.bytes
Binary file not shown.
8 changes: 8 additions & 0 deletions Assets/GameMain/LubanTables.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/GameMain/Scripts/Editor/Luban.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 59 additions & 0 deletions Assets/GameMain/Scripts/Editor/Luban/LubanGenerator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using System;
using System.IO;
using UnityEditor;
using UnityEngine;

public class LubanGenerator
{
public static System.Diagnostics.Process CreateShellExProcess(string cmd, string args, string workingDir = "")
{
var pStartInfo = new System.Diagnostics.ProcessStartInfo(cmd);
pStartInfo.Arguments = args;
pStartInfo.CreateNoWindow = false;
pStartInfo.UseShellExecute = true;
pStartInfo.RedirectStandardError = false;
pStartInfo.RedirectStandardInput = false;
pStartInfo.RedirectStandardOutput = false;

if (!string.IsNullOrEmpty(workingDir))
pStartInfo.WorkingDirectory = workingDir;

return System.Diagnostics.Process.Start(pStartInfo);
}
public static string FormatPath(string path)
{
path = path.Replace("/", "\\");

if (Application.platform == RuntimePlatform.OSXEditor)
path = path.Replace("\\", "/");

return path;
}

private static void ProcessRun(string batName)
{
string toolsPath = FormatPath(Application.dataPath + "/../LubanTools/");
string path = Path.Combine(toolsPath, batName);
if (!File.Exists(toolsPath + batName))
{
Debug.LogError("当前的bat执行文件不存在" + path);
}
else
{
var process = CreateShellExProcess(batName, "", toolsPath);
process.Close();
}
}

[MenuItem("Luban/生成Binary文件")]
private static void GenCodeBin()
{
ProcessRun("gen_code_bin_client_server.bat");
}

[MenuItem("Luban/生成json文件")]
private static void GenCodeJson()
{
ProcessRun("gen_code_json_client_server.bat");
}
}
11 changes: 11 additions & 0 deletions Assets/GameMain/Scripts/Editor/Luban/LubanGenerator.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/GameMain/Scripts/Main/Luban.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/GameMain/Scripts/Main/Luban/LubanLib.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Assets/GameMain/Scripts/Main/Luban/LubanLib/BeanBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Bright.Serialization;

namespace Bright.Config
{
public abstract class BeanBase : ITypeId
{
public abstract int GetTypeId();
}
}
11 changes: 11 additions & 0 deletions Assets/GameMain/Scripts/Main/Luban/LubanLib/BeanBase.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 999e344

Please sign in to comment.