Exemplo n.º 1
0
 MiniLuaInEditor()
 {
     Debug.Log("MiniLuaInEditor Ctor");
     luaEnv = new LuaEnv();
     if (luaEnv != null)
     {
         luaEnv.AddLoader(CustomLoader);
         LuaBehaviorAutoParameters.Register(luaEnv);
     }
 }
Exemplo n.º 2
0
    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();
        }
    }