UIBuffGroup - jimdroberts/FishMMO GitHub Wiki
A UI component representing a group for a buff or debuff in the FishMMO client. Displays the buff icon, tooltip, duration slider, and label. Intended to be used as part of the buff UI to show active buffs or debuffs on the player.
-
public Image Icon
The icon representing the buff or debuff.
-
public UITooltipButton TooltipButton
The tooltip button for displaying additional information about the buff or debuff.
-
public Slider DurationSlider
The slider showing the remaining duration of the buff or debuff.
-
public TMP_Text ButtonText
The text label for the buff or debuff button.
- Attach
UIBuffGroup
to a buff group UI GameObject in the Unity Editor. - Assign the
Icon
,TooltipButton
,DurationSlider
, andButtonText
fields in the Inspector. - Integrate with the buff UI to update the group when a buff or debuff is added or updated.
// Example usage in a MonoBehaviour
public UIBuffGroup buffGroup;
void ShowBuff(Buff buff) {
buffGroup.Icon.sprite = buff.Template.Icon;
buffGroup.ButtonText.text = buff.Template.Name;
buffGroup.DurationSlider.value = buff.RemainingTime / buff.Template.Duration;
// Set up tooltip as needed
}
- Always assign all UI references in the Inspector to avoid null reference errors.
- Update the UI fields whenever a new buff or debuff is added or updated.
- Use the duration slider to give clear feedback on buff/debuff duration.
- Integrate with the tooltip system for additional information display.