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