Files
test/Assets/PerfectWorld/Scripts/UI/GamePlay/AUIToggle.cs
T
2026-04-07 14:52:34 +07:00

101 lines
3.0 KiB
C#

using BrewMonster.Assets.PerfectWorld.Scripts.UI.GamePlay;
using UnityEngine;
using UnityEngine.UI;
namespace BrewMonster
{
public class AUIToggle : AUIImagePictureBase
{
[Header("SkillToggleUI")]
[SerializeField] protected int skillID;
[SerializeField] protected Toggle uiToggle;
public override void Awake()
{
return;
}
public void SetSkillID(int id)
{
skillID = id;
}
public override void SetImage(Sprite sprite)
{
if (disPlayImage == null)
{
return;
}
disPlayImage.sprite = sprite;
disPlayImage.gameObject.SetActive(true);
}
public override void Clear()
{
base.Clear();
}
}
/// <summary>Merged open/close skill selection for assign UI (replaces OpenAssignSkillEvent + CloseAssignSkillEvent).</summary>
public struct AssignSkillSelectionChangedEvent
{
public int skillID;
public bool selected;
public AssignSkillSelectionChangedEvent(int skillId, bool selected)
{
skillID = skillId;
this.selected = selected;
}
}
// public struct OpenAssignSlotEvent
// {
// public int slotIndex;
// public OpenAssignSlotEvent(int index)
// {
// slotIndex = index;
// }
// }
// public struct CloseAssignSlotEvent
// {
// public int slotIndex;
// public CloseAssignSlotEvent(int index)
// {
// slotIndex = index;
// }
// }
public struct OnAssignSkillEvent
{
public int skillID;
public int slotIndex;
public OnAssignSkillEvent(int skillID, int slotIndex)
{
this.skillID = skillID;
this.slotIndex = slotIndex;
}
}
/// <summary>Action palette row selection for quickbar assign (same order as CDlgSkillSubAction shortcut sets).</summary>
public struct AssignActionSelectionChangedEvent
{
public int actionSetIndex;
public int shortcutIndexInSet;
public bool selected;
public AssignActionSelectionChangedEvent(int actionSetIndex, int shortcutIndexInSet, bool selected)
{
this.actionSetIndex = actionSetIndex;
this.shortcutIndexInSet = shortcutIndexInSet;
this.selected = selected;
}
}
/// <summary>Published after an action shortcut is written to the assign cache; palette uses indices to UncheckAfterAssign.</summary>
public struct OnAssignActionEvent
{
public int actionSetIndex;
public int shortcutIndexInSet;
public int quickbarSlotIndex;
public OnAssignActionEvent(int actionSetIndex, int shortcutIndexInSet, int quickbarSlotIndex)
{
this.actionSetIndex = actionSetIndex;
this.shortcutIndexInSet = shortcutIndexInSet;
this.quickbarSlotIndex = quickbarSlotIndex;
}
}
}