16 [Export]
public bool EditId {
get => _editId;
set => SetValidatedField(ref _editId, value); }
23 private void SetValidatedField<T>(ref T field, T value)
26 NotifyPropertyListChanged();
29 public override void _ValidateProperty(Godot.Collections.Dictionary property)
31 base._ValidateProperty(property);
32 var name =
property[
"name"].AsStringName();
34 if (name == PropertyName.Id)
36 var flag =
EditId ? PropertyUsageFlags.None : PropertyUsageFlags.ReadOnly;
37 property[
"usage"] = (int)(PropertyUsageFlags.Default | flag);
A reference for a collectable with a unique ID.
bool EditId
If true, the Id property becomes editable in the inspector.
int Id
The unique ID associated with the collectable.
Contains the random number generator used for ID and random seed assignments.
static int GetRandomId()
Returns a random positive integer ID.