Interface IEntity

The Interface for an Entity.

interface IEntity {
    _isAlive: boolean;
    _myLatestCopyEntityUID: number;
    entityUID: number;
    objectUID: number;
    uniqueName: string;
    _copyFrom(rnObject: RnObject): void;
    _destroy(): void;
    _removeComponent(componentTID: number): void;
    _setComponent(componentType: typeof Component, com: Component): void;
    getComponent(componentType: typeof Component): undefined | Component;
    getComponentByComponentTID(componentTID: number): undefined | Component;
    getTagValue(tagName: string): any;
    hasComponent(componentType: typeof Component): boolean;
    matchTag(tagName: string, tagValue: string): boolean;
    matchTags(tags: RnTags): boolean;
    matchTagsAsFreeStrings(stringArray: string[]): boolean;
    tryToGetAnimation(): undefined | AnimationComponent;
    tryToGetAnimationState(): undefined | AnimationStateComponent;
    tryToGetBlendShape(): undefined | BlendShapeComponent;
    tryToGetCamera(): undefined | CameraComponent;
    tryToGetCameraController(): undefined | CameraControllerComponent;
    tryToGetConstraint(): undefined | ConstraintComponent;
    tryToGetEffekseer(): undefined | EffekseerComponent;
    tryToGetLight(): undefined | LightComponent;
    tryToGetMesh(): undefined | MeshComponent;
    tryToGetMeshRenderer(): undefined | MeshRendererComponent;
    tryToGetPhysics(): undefined | PhysicsComponent;
    tryToGetSceneGraph(): undefined | SceneGraphComponent;
    tryToGetSkeletal(): undefined | SkeletalComponent;
    tryToGetTransform(): undefined | TransformComponent;
    tryToGetVrm(): undefined | VrmComponent;
    tryToSetTag(tag: Tag): boolean;
    tryToSetUniqueName(name: string, toAddNameIfConflict: boolean): boolean;
    validateTagString(val: string): boolean;
}

Hierarchy (view full)

Implemented by

Properties

_isAlive: boolean
_myLatestCopyEntityUID: number
entityUID: number
objectUID: number

Unique identifier for the object

uniqueName: string

Unique name string for the object

Methods

  • Internal

    Removes a component from this entity.

    Parameters

    • componentTID: number

      The component type identifier to remove

    Returns void

  • Internal

    Sets a component on this entity.

    Parameters

    • componentType: typeof Component

      The constructor/class of the component

    • com: Component

      The component instance to set

    Returns void

  • Retrieves a component of the specified type from this entity.

    Parameters

    • componentType: typeof Component

      The constructor/class of the component to retrieve

    Returns undefined | Component

    The component instance if found, undefined otherwise

  • Retrieves a component by its unique component type identifier.

    Parameters

    • componentTID: number

      The component type identifier

    Returns undefined | Component

    The component instance if found, undefined otherwise

  • Checks whether this entity has a component of the specified type.

    Parameters

    • componentType: typeof Component

      The constructor/class of the component to check

    Returns boolean

    True if the entity has the component, false otherwise

  • Checks if an object matches a specific tag name and value

    Parameters

    • tagName: string

      The tag name to match

    • tagValue: string

      The tag value to match

    Returns boolean

    True if the tag matches, false otherwise

  • Checks if the object has all the specified tags with matching values

    Parameters

    • tags: RnTags

      The tags object to match against

    Returns boolean

    True if all tags match, false otherwise

  • Checks if the object's combined tag string contains all provided strings

    Parameters

    • stringArray: string[]

      Array of strings to search for in tags

    Returns boolean

    True if all strings are found, false otherwise

  • Attempts to retrieve the AnimationStateComponent from this entity.

    Returns undefined | AnimationStateComponent

    The AnimationStateComponent if present, undefined otherwise

  • Attempts to retrieve the ConstraintComponent from this entity.

    Returns undefined | ConstraintComponent

    The ConstraintComponent if present, undefined otherwise

  • Attempts to set a tag on the object

    Parameters

    • tag: Tag

      The tag object containing name and value

    Returns boolean

    True if the tag was successfully set, false otherwise

  • Attempts to set a unique name for the object

    Parameters

    • name: string

      The desired unique name

    • toAddNameIfConflict: boolean

      Whether to modify the name if it conflicts with existing names

    Returns boolean

    True if the name was successfully set, false otherwise

  • Validates a tag string to ensure it contains only allowed characters

    Parameters

    • val: string

      The string to validate

    Returns boolean

    True if the string is valid, false otherwise