New answers tagged

0

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); ...


1

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


0

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