Skip to content

Commit 8926ff0

Browse files
committed
Fix bugs
1 parent 662813a commit 8926ff0

23 files changed

+201
-74
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [1.0.1] - 2023-08-23
4+
5+
- Fix bugs
6+
37
## [1.0.0] - 2023-08-20
48

59
- Release

Editor/Scripts/CodeExecutorData.cs

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,39 @@ private class UserData
1818
{
1919
public int version = 0;
2020
public SnippetInfo newSnippet = new SnippetInfo();
21-
public List<SnippetInfo> snippets = new List<SnippetInfo>();
21+
public List<SnippetInfo> snippets = new List<SnippetInfo>()
22+
{
23+
new SnippetInfo()
24+
{
25+
guid = "e48e9761-cf81-4540-8155-dde48362a5b0",
26+
createTime = 0,
27+
editTime = 0,
28+
top = false,
29+
name = "HelloWorld",
30+
code = "UnityEngine.Debug.Log(\"[CodeExecutor] Hello World!\");\nUnityEngine.Debug.LogWarning(\"[CodeExecutor] Hello World!\");\nUnityEngine.Debug.LogError(\"[CodeExecutor] Hello World!\");",
31+
mode = "C#"
32+
},
33+
new SnippetInfo()
34+
{
35+
guid = "6ac20611-c6ec-4971-a121-7ff01b44b84f",
36+
createTime = 0,
37+
editTime = 0,
38+
top = false,
39+
name = "CrazyThursday",
40+
code = "UnityEngine.Debug.LogError(\"[CodeExecutor] Crazy Thursday\");",
41+
mode = "C#"
42+
},
43+
new SnippetInfo()
44+
{
45+
guid = "e4db94ed-9244-492a-9f88-bdee5ed616fd",
46+
createTime = 0,
47+
editTime = 0,
48+
top = false,
49+
name = "TestImport",
50+
code = "@import(\"CrazyThursday\")\r\n\nUnityEngine.Debug.LogError(\"[CodeExecutor] V Me 50\");",
51+
mode = "C#"
52+
},
53+
};
2254
}
2355

2456
private static UserData s_UserData;

Editor/Scripts/CodeExecutorManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public static void Open(bool forceReopen = false)
8585
/// </summary>
8686
/// <param name="content"></param>
8787
/// <param name="fadeoutWait"></param>
88-
public static bool ShowNotification(string content, double fadeoutWait = 1f)
88+
public static bool ShowNotification(string content, double fadeoutWait = 1d)
8989
{
9090
if (!CodeExecutorWindow.HasOpenInstances())
9191
{

Editor/Scripts/CodeExecutorSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ private class Settings
1818
public int fontSize = 12;
1919
public bool enableBuiltinExecModeCSharp = true;
2020
public bool enableBuiltinExecModeXLua = true;
21-
public bool enableBuiltinExecModeXLuaCustom = true;
21+
public bool enableBuiltinExecModeXLuaCustom = false;
2222
}
2323

2424
private static Settings s_Settings;

Editor/Scripts/Examples/CSharp.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Editor/Scripts/Examples/InjectHelperCSharp.cs renamed to Editor/Scripts/Examples/CSharp/ExecutionHelperCSharp.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ namespace ChenPipi.CodeExecutor.Examples
1111
{
1212

1313
/// <summary>
14-
/// CodeExecutor C# 注入工具
14+
/// CodeExecutor C# 执行工具
1515
/// </summary>
16-
public static class InjectHelperCSharp
16+
public static class ExecutionHelperCSharp
1717
{
1818

1919
/// <summary>

Editor/Scripts/Examples/CodeExecutorInjectorCSharp.cs renamed to Editor/Scripts/Examples/CSharp/InjectorCSharp.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ namespace ChenPipi.CodeExecutor.Examples
77
{
88

99
/// <summary>
10-
/// 给 CodeExecutor 注入 C# 代码执行模式
10+
/// 给 CodeExecutor 注入代码执行模式
1111
/// </summary>
12-
public static class CodeExecutorInjectorCSharp
12+
public static class InjectorCSharp
1313
{
1414

1515
/// <summary>
@@ -31,7 +31,7 @@ private static void Register()
3131

3232
public static object[] Executor(string code)
3333
{
34-
object[] results = InjectHelperCSharp.ExecuteSnippetCode(code);
34+
object[] results = ExecutionHelperCSharp.ExecuteSnippetCode(code);
3535

3636
CodeExecutorManager.ShowNotification("Executed");
3737

Editor/Scripts/Examples/XLua.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)