Esempio n. 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);
     }
 }
Esempio n. 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);
     }
 }
Esempio n. 3
0
 public static int get_timeScale(IntPtr L)
 {
     Debug.Log(Time.timeScale);
     LuaAPI.PushNumber(L, UnityEngine.Time.timeScale);
     return(1);
 }
Esempio n. 4
0
 public static void PushNumber(IntPtr L, double d)
 {
     LuaAPI.PushNumber(L, d);
 }