New answers tagged


After the @DMGregory♦ comment I come across this documentation. So, to have the changes made through the editor API serialized correctly I did change this way: Undo.RecordObject(gameObjectInScene, "Set reference for itsField."); gameObjectInScene.itsField = theFieldValue; PrefabUtility.RecordPrefabInstancePropertyModifications(gameObjectInScene); ...


You can just assign the value in code. myGameObject = thingToAssign; You may want to do this in OnValidate or with ExecuteInEditMode.


So, as #DMGregory pointed out the classes inside the editor folder can not be referenced by classes outside of the editor folder. But the classes inside the editor folder can easily reference classes outside the editor folder. Given all that here is how I solved the issue. I created a folder named game_editor and moved the RequiredInterfaceAttribute into it. ...

Top 50 recent answers are included