Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Feedback Please save prefab modified property in edit mode only with inspector

Discussion in 'Prefabs' started by Thaina, Aug 1, 2019.

  1. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    240
    Since we have
    ExecuteInEditMode
    and
    ExecuteAlways
    attribute. We could write same code to run in both runtime and editor that dynamically react to things. Such as a canvas UI that calculate and resize itself responsively to screen dimension or showing a real time clock while editing in edit mode

    But I don't want to have that dynamic value that set from the code being saved as asset and become default value. And on the contrary, most of the time, I don't want to set
    hideFlags
    to
    HideFlags.DontSave
    because I want to intentionally set that prefab asset's value with inspector or other kind of editor command

    So I think unity editor should not save the value that was edited from component to the prefab, it should be some flag to tell the prefab saver that, while the editor executing component update loop or when just the layout changed event, it must not save the value modified in these cases into prefab

    Or maybe we should have
    HideFlags.DontSaveExecuteInEditModeComponent
    to let this behaviour possible
     
    Last edited: Aug 1, 2019
    Jes28 likes this.