Null value for task field

xjjon

New member
How can I get a task field to be null?

It's always initialized/serialized by default.

Code:
class MyTask : Task {
  public SomeClass MyField; // I want this to be null by default
}

class SomeClass {
  public int Value;

}

On a side note, it would be amazing if the behavior designer inspector could utilize Odin attributes.
But otherwise I guess once I can get this serialized to null, I can write a custom object drawer for it.

Thanks
 
Upon more testing (looking at the json serialization), it's just the default drawer that will always draw the fields (even if the object is null)
However, once you set one of the fields, it will serialize (but there's no way to set it back to null in the default inspector).

Is that correct? So basically to be able to set it back to null - use a custom drawer?
 
However, once you set one of the fields, it will serialize (but there's no way to set it back to null in the default inspector).

Is that correct? So basically to be able to set it back to null - use a custom drawer?
Yes, that's correct.

Odin integration would be really nice, and you could accomplish it through object drawers, but at this point there are other higher priority items.
 
Top