61 lines
1.9 KiB
C#
61 lines
1.9 KiB
C#
using CodeStage.AntiCheat.ObscuredTypes;
|
|
using UnityEngine;
|
|
|
|
public class MapChoiceUI_DungeonBase : MonoBehaviour
|
|
{
|
|
public int SelectMapID = 1001; // 프리팹에서 설정
|
|
|
|
protected BattleMapConfigTableData m_mapData;
|
|
|
|
protected ObscuredInt _SelectLv;
|
|
public int SelectLv
|
|
{
|
|
get { return _SelectLv; }
|
|
set { _SelectLv = value; _SelectLv.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
public void Set(bool active) { gameObject.SetActive(active); }
|
|
public virtual void Set()
|
|
{
|
|
Set(true);
|
|
var sdata = ServerInfo.Ins.m_ServerData;
|
|
m_mapData = table_battlemapconfig.Ins.Get_Data(SelectMapID);
|
|
SelectLv = sdata.Get_DungeonLv(m_mapData.e_Dungeon) + 1;
|
|
var dungeonData = table_dungeonmapconfig.Ins.Get_Data_orNull(m_mapData.e_Dungeon, SelectLv);
|
|
if (DSUtil.CheckNull(dungeonData))
|
|
{
|
|
for (int i = 0; i < SelectLv; i++)
|
|
{
|
|
--SelectLv;
|
|
dungeonData = table_dungeonmapconfig.Ins.Get_Data_orNull(m_mapData.e_Dungeon, SelectLv);
|
|
if (!DSUtil.CheckNull(dungeonData))
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
public virtual void OnClick_GoDungeon() { }
|
|
protected void Go_Dungeon()
|
|
{
|
|
NewGameUI.Ins.m_MapChoiceUI.OnClick_Back();
|
|
|
|
MyValue.MyChoiceMapData.n_Difficult = 1; // TODO 정인호 : 나중에 선택한 난이도 넣어줄 것
|
|
MyValue.MyChoiceMapData.n_MapID = SelectMapID;
|
|
MyValue.MyChoiceMapData.n_PortalIndex = 0;
|
|
MyValue.MyChoiceMapData.n_DungeonLv = SelectLv;
|
|
|
|
InGameInfo.Ins.Load_Map(SelectMapID);
|
|
}
|
|
|
|
protected void Use_Ticket()
|
|
{
|
|
ServerInfo.Ins.m_ServerData.Use_Item(m_mapData.n_TicketID, 1);
|
|
ServerInfo.Ins.Write(null, false);
|
|
}
|
|
|
|
public virtual void OnClick_Ranking()
|
|
{
|
|
var mapData = table_battlemapconfig.Ins.Get_Data(SelectMapID);
|
|
RankingMgr.Ins.Show_Rank(mapData.e_Dungeon);
|
|
}
|
|
} |