Class ComponentStateMachine<State>

Core functionality of the state machine, holding solely the current state and, while in transition, the next state, the instructions for the machine and comfort methods to transit and act.

Type Parameters

  • State

Hierarchy

  • ComponentScript
    • ComponentStateMachine

Implements

Constructors

Properties

stateCurrent: State
stateNext: State
baseClass: typeof Component

refers back to this class from any subclass e.g. in order to find compatible other resources

iSubclass: number
subclasses: typeof Component[]

list of all the subclasses derived from this class, if they registered properly

Accessors

  • get isSingleton(): boolean
  • Is true, when only one instance of the component class can be attached to a node

    Returns boolean

  • get node(): Node
  • Retrieves the node, this component is currently attached to

    Returns Node

  • get type(): string
  • Retrieves the type of this mutable subclass as the name of the runtime class

    Returns string

    The type of the mutable

Methods

  • De- / Activate this component. Inactive components will not be processed by the renderer.

    Parameters

    • _on: boolean

    Returns void

  • See EventTarget.addEventListener for reference. Works with EventListenerUnified and EventUnified

    Parameters

    • _type: string
    • _handler: EventListenerUnified
    • Optional _options: boolean | AddEventListenerOptions

    Returns void

  • Tries to attach the component to the given node, removing it from the node it was attached to if applicable

    Parameters

    • _container: Node

    Returns void

  • Parameters

    • _serialization: Serialization

    Returns Promise<Serializable>

  • See EventTarget.dispatchEvent for reference. Works with with EventUnified

    Parameters

    • _event: EventUnified

    Returns boolean

  • Override this to draw visual aids for this component inside the editors render view. Use Gizmos inside the override to draw stuff.

    Parameters

    • Optional _cmpCamera: ComponentCamera

    Returns void

  • See drawGizmos. Only displayed while the corresponding node is selected.

    Parameters

    • Optional _cmpCamera: ComponentCamera

    Returns void

  • Retrieves the specified Metadata.attributeTypes | attribute types from the Metadata | metadata of this instance's class.

    Returns MetaAttributeTypes

  • Retrieves the Metadata | metadata of this instance's class.

    Returns Metadata

  • Collect applicable attributes of the instance and copies of their values in a Mutator-object. By default, a mutator cannot be extended, since extensions are not available in the object the mutator belongs to. A mutator may be reduced by the descendants of Mutable to contain only the properties needed.

    Parameters

    • Optional _extendable: boolean

    Returns Mutator

  • Returns an associative array with the same attributes as the given mutator, but with the corresponding types as string-values. Does not recurse into objects! This will return the decorated Metadata meta-type instead of the runtime-type of the object, if available.

    Parameters

    • _mutator: Mutator

    Returns MutatorAttributeTypes

  • Collect the attributes of the instance and their values applicable for animation. Basic functionality is identical to getMutator, returned mutator should then be reduced by the subclassed instance

    Parameters

    • Optional _extendable: boolean

    Returns MutatorForAnimation

  • Collect the attributes of the instance and their values applicable for the user interface. Basic functionality is identical to getMutator, returned mutator should then be reduced by the subclassed instance

    Parameters

    • Optional _extendable: boolean

    Returns MutatorForUserInterface

  • Parameters

    • _mutator: Mutator
    • Optional _selection: string[]
    • Optional _dispatchMutate: boolean

    Returns Promise<void>

  • See EventTarget.removeEventListener for reference. Works with EventListenerUnified and EventUnified

    Parameters

    • _type: string
    • _handler: EventListenerUnified
    • Optional _options: boolean | AddEventListenerOptions

    Returns void

  • Updates the values of the given mutator according to the current state of the instance

    Parameters

    • _mutator: Mutator

    Returns void

  • Decorator allows to attach Mutable functionality to existing classes.

    Parameters

    • _mutator: Mutator
    • _path: string[]

    Returns Mutator