Class UITKAbilityCraft
UI Toolkit ability crafting panel: a base ability, the effects configured onto it, and a live preview of what the two would produce.
public class UITKAbilityCraft : UITKCharacterControl
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourUITKAbilityCraft
- 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
Remarks
Crafting is the game's ability designer. A base ability is the core — a fireball that hangs in the air — and effects configure it: one to move it forward, one to make it bigger. Each effect pays for itself in cooldown, cast time and resource cost as well as in currency, and the point of this panel is that the player can see that trade before they commit.
The preview is composed by AbilitySummary — the same composition the server performs when it builds the crafted ability, and the same one the finished ability's tooltip reports afterwards. It used to be a third, separate calculation that ignored the effects a template already ships with, so the preview and the ability the player received disagreed. Every stat now also carries what the chosen effects changed it by.
Fields
CurrencyTemplateID
The template ID for the currency used to craft abilities.
[TemplateReference(typeof(CharacterAttributeTemplate))]
public int CurrencyTemplateID
Field Value
Methods
OnAfterShow()
Called at the end of Show(), against the tree the player will actually see. Override to write content that changes from one opening to the next.
protected override void OnAfterShow()
Remarks
This exists because "set the text, then Show" does not work and fails silently. UnityEngine.UIElements.UIDocument clones the UXML on enable, so a panel that fills in its message, list rows or icon before calling Show() writes into a tree that is thrown away microseconds later, and the player sees whatever the UXML declares — an empty dialog, a blank tooltip, a selector with no rows.
Distinct from OnAfterStarting(), which re-applies state after the tree is rebuilt. This one runs on every show, rebuilt tree or not.
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.
OnClientSet()
Registers the ability crafter broadcast handlers when the client is set.
public override void OnClientSet()
OnClientUnset()
Unregisters the ability crafter broadcast handlers when the client is unset.
public override void OnClientUnset()
OnCraft()
Sends the craft request.
public void OnCraft()
OnDestroying()
Clears all slots when the UI is being destroyed.
public override void OnDestroying()
OnStarting()
Queries panel elements and wires the base entry, craft, and close buttons.
public override void OnStarting()
OnTick()
Releases a submit lock whose reply never arrived.
protected override void OnTick()