MetaField
class MetaFieldTSerializedValueTValue extends TSerializedValue = TSerializedValue
Represents an entry in the meta file.
Type Parameters
TSerializedValueThe type used to store this field in the meta file.
TValue extends TSerializedValue = TSerializedValueThe runtime type of this field.
Extended by
BoolMetaFieldColorMetaFieldEnumMetaFieldExporterMetaFieldNumberMetaFieldRangeMetaFieldStringMetaFieldVector2MetaField
Constructors​
constructor​
public new MetaFieldTSerializedValueTValue = TSerializedValuename: stringinitial: TValue: MetaFieldTSerializedValueTValue
Type Parameters
Parameters
name: stringThe name of this field displayed in the editor.
initial: TValueThe 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: stringThe description.
disable​
public disablevalue: boolean = true: MetaFieldTSerializedValueTValue
Disable or enable the field in the editor.
Parameters
value: boolean = trueWhether 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: TSerializedValueThe serialized value.
serialize​
public serialize(): TSerializedValue
Serialize the value of this field.
set​
public setvalue: TSerializedValue: void
Set the current value.
Parameters
value: TSerializedValueThe new value.
space​
public spacevalue: boolean = true: MetaFieldTSerializedValueTValue
Add or remove spacing at the beginning of this field.
Parameters
value: boolean = trueWhether to include the spacing.