The base class for all components. Components are attached to SceneObjects.

//@input Component component
if(script.component.isOfType("Component.MaterialMeshVisual")){
var mat = script.component.mainMaterial;
}
interface Component {
    enabled: boolean;
    sceneObject: SceneObject;
    uniqueIdentifier: string;
    destroy(): void;
    getSceneObject(): SceneObject;
    getTransform(): Transform;
    getTypeName(): string;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
}

Hierarchy (view full)

Properties

enabled: boolean

If disabled, the Component will stop enacting its behavior.

sceneObject: SceneObject
uniqueIdentifier: string

Methods

  • Destroys the component.

    Returns void

  • Returns the Transform this component is attached to.

    Returns Transform

  • Returns true if the object matches or derives from the passed in type.

    Parameters

    • type: string

    Returns boolean

  • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

    Parameters

    Returns boolean