@kognifai/cogsengine
    Preparing search index...

    Class ChildCollection

    Class handling collection of children, e.g. in SceneComponent.children. Will keep children Entities in sync with Cogs engine.

    Index

    Constructors

    Accessors

    Methods

    Constructors

    Accessors

    • get length(): number

      Gets number of children

      Returns number

    Methods

    • Add child, e.g. sceneComponent.children.add(child: Entity); The child can only be added to one parent.

      Parameters

      • child: Entity

        Child entity to add

      Returns void

    • Gets the child Entity at the given index, allowing for positive and negative integers.

      Parameters

      • index: number

        The index (position) of the array element to be returned. Supports relative indexing from the end of the array when passed a negative index; i.e. if a negative number is used, the element returned will be found by counting back from the end of the array.

      Returns Entity | undefined

      The element in the array matching the given index. Undefined if outside.

    • Remove all child entities. E.g. sceneComponent.children.clear()

      Returns void

    • Internal: Add All children, called by Bridge.GetChildren

      Parameters

      • entityIds: Int32Array

        New set of children.

      Returns void

    • Remove child, sceneComponent.children.remove(child: Entity);

      Parameters

      • child: Entity

        Child entity to remove

      Returns void