UIAttribute - jimdroberts/FishMMO GitHub Wiki

Description

A UI component for displaying a single character attribute's name and value in the FishMMO client. Intended to be used as part of the equipment or character stats UI to show individual attributes.


API Access

Fields

  • public TMP_Text Name

    The label displaying the attribute name.

  • public TMP_Text Value

    The label displaying the attribute value.


Basic Usage

Setup

  1. Attach UIAttribute to an attribute UI GameObject in the Unity Editor.
  2. Assign the Name and Value fields in the Inspector.
  3. Set the text fields to display the desired attribute name and value.

Example

// Example usage in a MonoBehaviour
public UIAttribute attributeUI;

void ShowAttribute(string attributeName, string attributeValue) {
    attributeUI.Name.text = attributeName;
    attributeUI.Value.text = attributeValue;
}

Best Practices

  • Always assign the Name and Value in the Inspector to avoid null reference errors.
  • Use this component as part of a list or grid to display multiple attributes.
  • Update the text fields whenever the attribute values change.
⚠️ **GitHub.com Fallback** ⚠️