suggest editor code when the graph owner's Blackboard Inspector is changed.

NodeCanvas Forums General Discussion suggest editor code when the graph owner's Blackboard Inspector is changed.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #15463
    mystisle
    Participant

    Hello, I’d like to give you a small suggestion for the Graph Owner Inspector code.

    EditorGUI.BeginChangeCheck(); // add
    var label = EditorGUI.BeginProperty(rect, EditorUtils.GetTempContent(“Blackboard”), blackboardProp);
    owner.blackboard = (IBlackboard)EditorGUI.ObjectField(rect, label, owner.blackboard as Object, typeof(IBlackboard), true);
    EditorGUI.EndProperty();
    if (EditorGUI.EndChangeCheck()) // add
    {
    EditorUtility.SetDirty(owner); // add
    }

    This code activates the dirty flag when the blackboard properties change.
    This is useful when pasting a blackboard and graph owner in prefab mode.
    Have a good day.

    #15471
    Gavalakis
    Keymaster

    Hey,

    I just did that, but on a bigger scope (to handle some other controls that were not handled as well).

    Thank you 🙂

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.