- Home /
EditorSceneManger.SetSceneDirty Problem
I'm using Editor scripting to create new scene , then add object to scene by instantiating using PrefabUtility. instantiate , this Object is a Prefab I get it using AssetDataBase.LoadAssetAtPath , this game Object has a Monobehavoir Script attached to it .
What I'm trying to do is to edit some public variable in the script using Editor scripting then save the scene using , EditorSceneManger.SaveScene , every thing is saved but the edit I did to the variable doesn't save .
I try EditorSceneManger.SetSceneDirty , EditorUtiltity.setDirty , Undo.RecordObject , adding [serlizeField] to the variable nothing is working .
Answer by EbalStudios · Dec 12, 2017 at 12:31 PM
I figure it out , since its a prefab instance with prefab connection is still on , I have to call PrefabUtility.RecordPrefabInstancePropertyModifications , and for some reason I have to call , Undo.RecordObject on that prefab instance before that .
Your answer
Follow this Question
Related Questions
How can i make both two cameras to follow the player but only one with control on player ? 0 Answers
2017.3 Editor frame drop and movement reaction speed [ISSUE] 1 Answer
Equivalent of OpenFilePanel without using UnityEditor? 5 Answers
Open settings dialog like Player, Quality, Render Settings via C#. 0 Answers
Serialize [,] 1 Answer