IndieGame/client/Assets/Scripts/Frame/Menu/MenuFrame.cs

37 lines
798 B
C#
Raw Permalink Normal View History

2024-10-24 23:44:04 +08:00
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
2024-10-24 23:44:04 +08:00
using UnityEngine;
namespace Ether
{
public enum MenuSubFrameType
{
ClueFrame,
MenuTipsFrame,
BagFrame,
MapFrame,
FriendFrame,
AchievementFrame,
SettingFrame,
}
public class MenuFrame : MenuFrameBase
2024-10-24 23:44:04 +08:00
{
protected override void OnShow()
{
_ToggleGroupExMenu.OnValueChange.AddListener(OnToggleValueChanged);
_ToggleGroupExMenu.SelectIndex = OpenFrameData.GetData<int>("SelectIndex");
}
private void OnToggleValueChanged(int selectIndex)
{
OpenFrameData openFrameData = new OpenFrameData();
openFrameData.SetParentFrameData(FrameData.FrameName, _TransSubFrameRoot);
UIManager.Inst.OpenFrame(((MenuSubFrameType)selectIndex).ToString(), openFrameData);
}
2024-10-24 23:44:04 +08:00
}
}