DirtyOnClick of ButtonAttribute does not work

Issue #834 resolved
kris rok created an issue

Consider this script:

using Sirenix.OdinInspector;
using UnityEngine;

public class ButtonDirtyOnClickIssue : MonoBehaviour
{
    [Button(DirtyOnClick = false)]
    public void DoNothing() { }
}

  1. Pressing the button marks the scene as dirty. The DirtyOnClick parameter set to false should prevent this though.
    Calling the same method using the good old ContextMenuAttribute keeps the scene non-dirty.
  2. Add the script to a GameObject, save the scene, press the button. The scene will be marked dirty.
  3. -
  4. Unity 2020.3.8f1
  5. Odin 3.0.12.0
  6. Tried both modes, does not matter
  7. Windows 10

Comments (5)

  1. Tor Esa Vestergaard

    This has now been fixed in the 3.1 beta branch, and will be included in the next 3.1 beta release this week.

  2. Log in to comment