Hi there,
We have a set of tools which we use to allow artists to safely edit prefabs without breaking any references.
The tools simply destroy some GameObjects in a prefab, replace them with new ones, and then update the appropriate references.
However, since the change to prefabs, making these changes in Prefab Mode don’t register and the Save button never activates (although the prefab updates correctly). It also doesn’t trigger the autosave. Making the same changes by hand in the same mode does.
I’ve tried marking the prefab as dirty, but that doesn’t activate the save button either. The PrefabUtility options seems to save the object as an override, but we don’t want that, we want them to behave as they do when you edit it manually.
We are simply doing this from an inspector window:
public void LoadDummyCharacter( string dummyCharacterId )
{
CharacterBase newDummyChar = LoadCharacterFromResourceFolder( dummyCharacterId );
if( myTarget.DummyCharacter != null )
{
DestroyImmediate( myTarget.DummyCharacter.gameObject );
}
if( newDummyChar != null )
{
myTarget.AssignDummyCharacterReference( newDummyChar );
myTarget.DummyCharacter.transform.parent = myTarget.transform;
myTarget.DummyCharacter.transform.localPosition = Vector3.zero;
myTarget.DummyCharacter.transform.localScale = Vector3.one;
myTarget.DummyCharacter.transform.localRotation = Quaternion.identity;
myTarget.DummyCharacter.gameObject.SetActive( true );
}
}
Any thoughts on what I can do to make the prefab detect that it has been changed, so we can save it?