Skip to main content

CharacterComponentControllerCollection

A class in Root.Township, Alta.Character.

Character controller that runs a list of child controllers: owned ones only when the character is local, unowned ones always.

Constructors​

MemberWhat it is
CharacterComponentControllerCollection()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

3 private and internal fields
MemberWhat it is
private bool invertOwnedUnownedOrderUpdates the unowned controllers before the owned ones instead of after.
private List<CharacterComponentController> ownedControllersControllers that only update on the local player's character. Backing field for Controllers.
private List<CharacterComponentController> unownedControllersControllers that update on every copy of the character, local or remote.

Properties​

MemberWhat it is
List<CharacterComponentController> Controllers { get; }The owned controllers, updated only when IsLocal.
override bool IsLocal { set; }Setting it also sets it on every child controller.

Methods​

MemberWhat it is
override void FixedUpdateCharacterComponent()Runs fixed update on enabled children, owned ones only if local. The owned and unowned order can be inverted.
T GetController<T>()First owned or unowned controller of type T, or null with a warning.
void SetActive(bool isActive)Enables or disables this and every child controller.
override void UpdateCharacterComponent()Same as FixedUpdateCharacterComponent, for the per-frame update.

Used in​

Members of other types that take, return or hold a CharacterComponentControllerCollection: