MiniLuaInEditor() { Debug.Log("MiniLuaInEditor Ctor"); luaEnv = new LuaEnv(); if (luaEnv != null) { luaEnv.AddLoader(CustomLoader); LuaBehaviorAutoParameters.Register(luaEnv); } }
void AutoParameters() { if (!string.IsNullOrEmpty(autoParameterString) && luaBehaviour.injections != null) { serializedObject.Update(); LuaBehaviorAutoParameters.Start(luaBehaviour, serializedObject); if (!LuaBehaviorAutoParameters.HasRecord(luaBehaviour) || lastUpdateTime < 0.0f || EditorApplication.timeSinceStartup - lastUpdateTime > 1.0f) { LuaBehaviorAutoParameters.StartRecord(luaBehaviour); MiniLuaInEditor lua = MiniLuaInEditor.Instance(); lua.DoFunction(autoParameterString, "AutoParameters"); lastUpdateTime = EditorApplication.timeSinceStartup; } else { LuaBehaviorAutoParameters.RunRecord(); } LuaBehaviorAutoParameters.End(); serializedObject.ApplyModifiedProperties(); } }