UIManaBar - jimdroberts/FishMMO GitHub Wiki

Description

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.


API Access

Inherits

  • UIResourceBar

Fields

  • (All fields are inherited from UIResourceBar)

Methods

  • (All methods are inherited from UIResourceBar)

Basic Usage

Setup

  1. Attach UIManaBar to a UI GameObject in the Unity Editor.
  2. Assign the slider and resourceValue fields in the Inspector.
  3. Set the Template field to the mana attribute template.

Example

// 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

Best Practices

  • Use UIManaBar for mana display and inherit from UIResourceBar 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.
⚠️ **GitHub.com Fallback** ⚠️