private void OnEnable() { if (obj == null || obj.Equals(null)) { obj = new SerializedObject(target); } if (luaVeiwer == null) { luaVeiwer = new QuickLuaViewer((msg) => { Log.E(msg); }); } }
void OnUndoRedoPerformed() { asset.isDirty = true; // Dumb hack to make sure the serialized object is up to date on undo (else there'll be // a state mismatch when this class is used in a GameObject inspector). if (m_SerializedObject != null && !m_SerializedObject.Equals(null) && m_SerializedObject.targetObject != null && !m_SerializedObject.targetObject.Equals(null)) { m_SerializedObject.Update(); m_SerializedObject.ApplyModifiedProperties(); } // Seems like there's an issue with the inspector not repainting after some undo events // This will take care of that m_BaseEditor.Repaint(); }