UIAttribute - jimdroberts/FishMMO GitHub Wiki
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.
-
public TMP_Text Name
The label displaying the attribute name.
-
public TMP_Text Value
The label displaying the attribute value.
- Attach
UIAttribute
to an attribute UI GameObject in the Unity Editor. - Assign the
Name
andValue
fields in the Inspector. - Set the text fields to display the desired attribute name and value.
// Example usage in a MonoBehaviour
public UIAttribute attributeUI;
void ShowAttribute(string attributeName, string attributeValue) {
attributeUI.Name.text = attributeName;
attributeUI.Value.text = attributeValue;
}
- Always assign the
Name
andValue
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.