DataBlock#
Base for project-defined shared gameplay data. Declare a public sealed class with public auto-properties using get/init. Supports scalar values, enums, SoundReference, SceneReference, DataReference<T>, inline DataRecord values and IReadOnlyList<T> collections. Use constant scalar defaults, empty record/list initializers, and no constructors or computed accessors. Resolve SceneReference properties with Entity.Find so local targets use the consuming object as context. Choose resource and definition references on the datablock. Nested values are read-only at runtime. Authoring uses the key data:Namespace.ClassName; plupy.data.of_type(key).new(name) creates one and props edits its C# property names. Instances are read-only gameplay definitions; keep health, timers and other changing state in scripts.
public abstract class DataBlockUsage and examples
Id#
public string Id { get; }Initial value: ""
The stable datablock ID, independent of its name and file location.
Name#
public string Name { get; }Initial value: ""
The authored display name.
Source#
- DataBlock.cs