Beispiel #1
0
 public static void PushArray(IntPtr L, object[] array)
 {
     LuaAPI.NewTable(L);
     LuaAPI.PushNumber(L, -1);
     LuaAPI.RawSetI(L, -2, 0);
     for (int i = 0; i < array.Length; i++)
     {
         PushObject(L, array[i]);
         LuaAPI.RawSetI(L, -2, i + 1);
     }
 }
Beispiel #2
0
 void PushToLua(Type type, object arg)
 {
     if (type == typeof(int))
     {
         LuaAPI.PushNumber(LuaEnv.L, (int)arg);
     }
     else if (type == typeof(UnityEngine.Object))
     {
         LuaAPI.PushObj(LuaEnv.L, (UnityEngine.Object)arg);
     }
 }
Beispiel #3
0
 public static int get_timeScale(IntPtr L)
 {
     Debug.Log(Time.timeScale);
     LuaAPI.PushNumber(L, UnityEngine.Time.timeScale);
     return(1);
 }
Beispiel #4
0
 public static void PushNumber(IntPtr L, double d)
 {
     LuaAPI.PushNumber(L, d);
 }