Skip to content

Commit

Permalink
some code mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
pangweiwei committed Nov 10, 2017
1 parent 88de5e3 commit 2c67255
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
6 changes: 6 additions & 0 deletions Assets/Plugins/Slua_Managed/LuaState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1604,6 +1604,12 @@ void setupPushVar()
{
LuaObject.pushValue(L, (LuaCSFunction)o);
};

regPushVar(typeof(UnityEngine.Vector2), (IntPtr L, object o) => { LuaObject.pushValue(L, (UnityEngine.Vector2)o); });
regPushVar(typeof(UnityEngine.Vector3), (IntPtr L, object o) => { LuaObject.pushValue(L, (UnityEngine.Vector3)o); });
regPushVar(typeof(UnityEngine.Vector4), (IntPtr L, object o) => { LuaObject.pushValue(L, (UnityEngine.Vector4)o); });
regPushVar(typeof(UnityEngine.Quaternion), (IntPtr L, object o) => { LuaObject.pushValue(L, (UnityEngine.Quaternion)o); });
regPushVar(typeof(UnityEngine.Color), (IntPtr L, object o) => { LuaObject.pushValue(L, (UnityEngine.Color)o); });
}

public int pushTry(IntPtr L)
Expand Down
25 changes: 17 additions & 8 deletions Assets/Slua/Editor/ModuleSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,35 @@
using System;
using System.Collections.Generic;

namespace SLua {

public class ModuleSelector : EditorWindow {
namespace SLua
{


#if UNITY_2017_2_OR_NEWER
public class ModuleSelector : EditorWindow
{
Vector2 scrollPosition = Vector2.zero;
public Action<string[]> onExport;
void OnGUI() {
void OnGUI()
{

List<string> modules = new List<string>();

scrollPosition=GUILayout.BeginScrollView(scrollPosition, GUILayout.Width(Screen.width), GUILayout.ExpandHeight(true));
foreach(string module in LuaCodeGen.unityModule) {
scrollPosition = GUILayout.BeginScrollView(scrollPosition, GUILayout.Width(Screen.width), GUILayout.ExpandHeight(true));
foreach (string module in LuaCodeGen.unityModule)
{
if (GUILayout.Toggle(true, module, GUILayout.ExpandWidth(false)))
modules.Add(module);
}
GUILayout.EndScrollView();
if (GUILayout.Button("Export", GUILayout.ExpandWidth(true))) {
if (GUILayout.Button("Export", GUILayout.ExpandWidth(true)))
{
if (onExport != null)
onExport(modules.ToArray());
}
}
}
}
#endif

}

0 comments on commit 2c67255

Please sign in to comment.