UIManaBar - jimdroberts/FishMMO GitHub Wiki
UIManaBar
is a UI component in the FishMMO client that displays the player's mana. It inherits all resource bar logic from UIResourceBar
and is specialized for showing mana values.
UIResourceBar
- (All fields are inherited from
UIResourceBar
)
- (All methods are inherited from
UIResourceBar
)
- Attach
UIManaBar
to a UI GameObject in the Unity Editor. - Assign the
slider
andresourceValue
fields in the Inspector. - Set the
Template
field to the mana attribute template.
// Example: Using UIManaBar in a scene
UIManaBar manaBar = GetComponent<UIManaBar>();
manaBar.slider = ...; // Assign Slider
manaBar.resourceValue = ...; // Assign TMP_Text
manaBar.Template = manaTemplate; // Assign CharacterAttributeTemplate for mana
- Use
UIManaBar
for mana display and inherit fromUIResourceBar
for other resource bars. - Always assign all required fields in the Inspector to avoid null references.
- Ensure the correct attribute template is set for mana.