Class UITKCharacterControl
Abstract base class for UI Toolkit controls that are bound to a player character. Extends UITKControl with the character set/clear lifecycle that UIManager drives on world entry and exit.
public abstract class UITKCharacterControl : UITKControl
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourUITKCharacterControl
- Derived
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.GetComponent<T>()Component.TryGetComponent<T>(out T)Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentInParent<T>()Component.GetComponentsInParent<T>()Component.GetComponents<T>()Component.GetComponentIndex()Component.CompareTag(TagHandle)Component.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.GetEntityId()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Fields
OnSetCharacter
Event invoked (after pre-set) when a character is associated with this control.
public Action<IPlayerCharacter> OnSetCharacter
Field Value
OnUnsetCharacter
Event invoked (before character is cleared) when the character association is removed.
public Action OnUnsetCharacter
Field Value
Properties
Character
The player character currently associated with this control.
public IPlayerCharacter Character { get; }
Property Value
Methods
OnAfterStarting()
Re-applies the character once the visual tree exists.
protected override void OnAfterStarting()
Remarks
World entry calls FishMMO.Client.UIManager.SetCharacter(FishMMO.Shared.Core.IPlayerCharacter) for every control at once, and
a control that starts hidden has no visual tree until something shows it — so
OnPostSetCharacter() can run before OnStarting has cached any
elements. Overrides that write into those elements would then dereference null, and
even a null-safe one would leave the panel showing nothing, because the only call
that had data already happened. Running it again here is what makes the two orders
equivalent.
OnDestroying()
Runs the character-unset path when this control is destroyed.
public override void OnDestroying()
Remarks
The unset path, not a bare null assignment. Panels drop their subscriptions to the character's events in OnPreUnsetCharacter(), and clearing the field behind their back skipped every one of them. The character outlives the panel — it is the panel that is destroyed on a scene change, not the character — so those still-live events kept invoking handlers on a destroyed MonoBehaviour: the panel is leaked by its own subscriptions, and the first handler to touch a Unity object throws MissingReferenceException from inside the character's event dispatch.
OnPostSetCharacter()
Invoked immediately after Character is assigned. Override to subscribe to events on the incoming character and refresh the UI.
public virtual void OnPostSetCharacter()
OnPostUnsetCharacter()
Invoked immediately after Character is cleared. Override to perform any post-unset cleanup.
public virtual void OnPostUnsetCharacter()
OnPreSetCharacter()
Invoked before Character is assigned. Override to unsubscribe from events on the outgoing character.
public virtual void OnPreSetCharacter()
OnPreUnsetCharacter()
Invoked before Character is cleared. Override to perform any pre-unset cleanup.
public virtual void OnPreUnsetCharacter()
SetCharacter(IPlayerCharacter)
Associates a player character with this control, invoking pre/post callbacks and the OnSetCharacter event.
public void SetCharacter(IPlayerCharacter character)
Parameters
characterIPlayerCharacterThe player character to associate.
UnsetCharacter()
Removes the player character association, invoking pre/post callbacks and the OnUnsetCharacter event.
public void UnsetCharacter()