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

37 lines
798 B
C#

using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
namespace Ether
{
public enum MenuSubFrameType
{
ClueFrame,
MenuTipsFrame,
BagFrame,
MapFrame,
FriendFrame,
AchievementFrame,
SettingFrame,
}
public class MenuFrame : MenuFrameBase
{
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);
}
}
}