MetaField
class MetaFieldTSerializedValueTValue extends TSerializedValue = TSerializedValue
Represents an entry in the meta file.
Type Parameters
TSerializedValue
The type used to store this field in the meta file.
TValue extends TSerializedValue = TSerializedValue
The runtime type of this field.
Extended by
BoolMetaField
ColorMetaField
EnumMetaField
ExporterMetaField
NumberMetaField
RangeMetaField
StringMetaField
Vector2MetaField
Constructors
constructor
public new MetaFieldTSerializedValueTValue = TSerializedValuename: stringinitial: TValue: MetaFieldTSerializedValueTValue
Type Parameters
Parameters
name: string
The name of this field displayed in the editor.
initial: TValue
The initial value of this field.
Properties
description
public description: string = ''
initial
The initial value of this field.
name
readonly public name: string
The name of this field displayed in the editor.
spacing
public spacing: boolean = false
type
readonly public type: any = undefined
The type of this field used by the editor to display the correct input.
Events
onChanged
public get onChanged(): SubscribableValueEventTValue
Triggered when the data of this field changes.
onDisabled
public get onDisabled(): SubscribableValueEventboolean
Triggered when the field becomes disabled or enabled.
Methods
clone
public clone(): MetaFieldTSerializedValueTValue
Create a clone of this field.
describe
public describedescription: string: MetaFieldTSerializedValueTValue
Set the description of this field.
Parameters
description: string
The description.
disable
public disablevalue: boolean = true: MetaFieldTSerializedValueTValue
Disable or enable the field in the editor.
Parameters
value: boolean = true
Whether the field should be disabled.
get
public get(): TValue
Get the current value.
parse
public parsevalue: TSerializedValue: TValue
Convert a serialized value into a runtime type.
Parameters
value: TSerializedValue
The serialized value.
serialize
public serialize(): TSerializedValue
Serialize the value of this field.
set
public setvalue: TSerializedValue: void
Set the current value.
Parameters
value: TSerializedValue
The new value.
space
public spacevalue: boolean = true: MetaFieldTSerializedValueTValue
Add or remove spacing at the beginning of this field.
Parameters
value: boolean = true
Whether to include the spacing.