s&box docs

public class Sandbox.ComponentList

Methods

Showing 24 methods

public T GetInAncestors(bool includeDisabled = False)

Find component on this gameobject's ancestors

Parameters

  • includeDisabled: Default: False

public T GetInAncestorsOrSelf(bool includeDisabled = False)

Find component on this gameobject's ancestors or on self

Parameters

  • includeDisabled: Default: False

public T GetInChildren(bool includeDisabled = False)

Find component on this gameobject's immediate children

Parameters

  • includeDisabled: Default: False

public T GetInChildrenOrSelf(bool includeDisabled = False)

Find component on this gameobject's immediate children or on self

Parameters

  • includeDisabled: Default: False

public T GetInDescendants(bool includeDisabled = False)

Find component on this gameobject's decendants

Parameters

  • includeDisabled: Default: False

public T GetInDescendantsOrSelf(bool includeDisabled = False)

Find component on this gameobject's decendants or on self

Parameters

  • includeDisabled: Default: False

public T GetInParent(bool includeDisabled = False)

Find component on this gameobject's parent

Parameters

  • includeDisabled: Default: False

public T GetInParentOrSelf(bool includeDisabled = False)

Find component on this gameobject's parent or on self

Parameters

  • includeDisabled: Default: False

public T GetOrCreate(Sandbox.FindMode flags = 7)

Find this component, if it doesn't exist - create it.

Parameters

  • flags: Default: 7

public void Move(Sandbox.Component baseComponent, int delta)

Move the position of the component in the list by delta (-1 means up one, 1 means down one)

public bool TryGet(T component, Sandbox.FindMode search = 5)

Try to get this component

Parameters

  • search: Default: 5

Properties

Showing 1 properties

public int Sandbox.ComponentList.Count { get; set; }

Amount of components - including disabled

Metadata

FieldValue
NamespaceSandbox
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.ComponentList

On this page

Methodspublic Sandbox.Component Create(Sandbox.TypeDescription type, System.Boolean startEnabled = True)public T Create(System.Boolean startEnabled = True)public Sandbox.Component FirstOrDefault(System.Func`2<Sandbox.Component,System.Boolean> value)public System.Void ForEach(System.String name, System.Boolean includeDisabled, System.Action`1<Sandbox.Component> action)public System.Void ForEach(System.String name, System.Boolean includeDisabled, System.Action`1<T> action)public Sandbox.Component Get(System.Guid id)public Sandbox.Component Get(System.Type type, Sandbox.FindMode find = 5)public T Get(Sandbox.FindMode search)public T Get(System.Boolean includeDisabled = False)public System.Collections.Generic.IEnumerable`1<Sandbox.Component> GetAll()public System.Collections.Generic.IEnumerable`1<Sandbox.Component> GetAll(Sandbox.FindMode find)public System.Collections.Generic.IEnumerable`1<Sandbox.Component> GetAll(System.Type type, Sandbox.FindMode find)public System.Collections.Generic.IEnumerable`1<T> GetAll(Sandbox.FindMode find = 69)public T GetInAncestors(System.Boolean includeDisabled = False)public T GetInAncestorsOrSelf(System.Boolean includeDisabled = False)public T GetInChildren(System.Boolean includeDisabled = False)public T GetInChildrenOrSelf(System.Boolean includeDisabled = False)public T GetInDescendants(System.Boolean includeDisabled = False)public T GetInDescendantsOrSelf(System.Boolean includeDisabled = False)public T GetInParent(System.Boolean includeDisabled = False)public T GetInParentOrSelf(System.Boolean includeDisabled = False)public T GetOrCreate(Sandbox.FindMode flags = 7)public System.Void Move(Sandbox.Component baseComponent, System.Int32 delta)public System.Boolean TryGet(T component, Sandbox.FindMode search = 5)Propertiespublic System.Int32 Sandbox.ComponentList.Count { get; set; }Metadata