Skip to content

Blackboard Drawer Does Not Dirty Object #1

@sim2kid

Description

@sim2kid

What's The Problem

When using the Blackboard drawer in Unity 2022.3.40f1, the modifications do not mark the Object as dirty and thus can not be saved to Scene, Prefab, or Scriptable Object.

It does appear to serialize and deserialize correctly.

What's The Expected Behavior

When making a property modification, the object should be marked as dirtied so it can be saved to disk.
For a prefab, this would be seen as auto-saving running (or, if disabled, the save button should be highlighted in the scene view).
For a scene, this would be seen as the scene having modifications as denoted by the * in the Hierarchy window.

What Version of Unity

  • 2022.3.40f1
  • 2022.3.35f1

Steps to Recreate

  1. Create a new 3D project (in this case, in Unity 2022.3.40f1)
  2. Import the BlackBoard and DictionaryDrawer files to the scripts folder.
  3. Create a SampleBehaviour with a serialized BlackBoard property (Exact code follows)
using UnityEngine;
public class SampleBehaviour : MonoBehaviour
{
    [SerializeField] Blackboard blackboard = new();
}
  1. In the provided sample scene, add the SampleBehaviour script to a gameobject (any if fine. I did the Directional Light as it was there).
  2. Save the scene so we know it's not dirty
  3. Make modifications to the blackboard via the property drawer. This can be adding, changing values or keys. Etc etc.
  4. Note that the Sample Scene is not marked as dirty. If you try to save at this point, the Sample Scene will not update. This can be proven by either reading the scene file or reloading the scene and seeing the changes are not present.

NoSceneChange
The gif above shows that the scene isn't marked as dirty when making modifications.

Note: Edited to be more detailed. It was late when I wrote this originally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions