131 lines
4.6 KiB
C#
131 lines
4.6 KiB
C#
using UnityEngine;
|
|
using UnityEngine.Rendering.Universal;
|
|
|
|
public class NewGameUI : MonoBehaviourSingletonTemplate<NewGameUI>
|
|
{
|
|
public Camera UICamera;
|
|
public GameObject[] gos; // 0 공용 ui, 1 로비 ui들, 2 인게임 ui들, 3 농장 ui들
|
|
public GameObject[] gos_ingame; // 0 스테이지, 1 던전
|
|
public Ingame_Dungeon ingame_dungeon;
|
|
public GameObject[] gos_etc; // 0 힘민지 레벨업
|
|
public Transform tf_HUD;
|
|
public GuideQuestUI m_GuideQuestUI;
|
|
public MapChoiceUI m_MapChoiceUI;
|
|
public BangchiUI m_BangchiUI;
|
|
public PCUI m_PCUI;
|
|
public EquipmentUI m_EquipmentUI;
|
|
public SkillUI m_SkillUI;
|
|
public PetUI m_PetUI;
|
|
public CollectionUI m_CollectionUI;
|
|
public BattleUI m_BattleUI;
|
|
public IngamePetCard[] arr_PetCard;
|
|
public BotMenuBase[] FarmMenu;
|
|
public MissionUI m_MissionUI;
|
|
public BuffADUI m_BuffADUI;
|
|
public GameObject[] gos_noti; // 0 우편
|
|
|
|
bool ShowQuick = true;
|
|
|
|
private void Start()
|
|
{
|
|
//ServerInfo.Ins.Check_OfflineReward();
|
|
m_GuideQuestUI.Set();
|
|
InGameInfo.Ins.Load_Map(-1);
|
|
var cameraData = Camera.main.GetUniversalAdditionalCameraData();
|
|
cameraData.cameraStack.Add(UICamera);
|
|
|
|
MailUI.Ins.Set(true);
|
|
}
|
|
|
|
#if UNITY_EDITOR
|
|
private void Update()
|
|
{
|
|
if (Input.GetKey(KeyCode.P))
|
|
UnityEditor.EditorApplication.isPaused = !UnityEditor.EditorApplication.isPaused;
|
|
}
|
|
#endif
|
|
|
|
public void SetUI_byGameMode(eGameMode gameMode, bool farm = false)
|
|
{
|
|
if (farm) gameMode = eGameMode.Stage;
|
|
|
|
switch (gameMode)
|
|
{
|
|
case eGameMode.Lobby:
|
|
DSUtil.InActivateGameObjects(gos, 0);
|
|
gos[1].SetActive(true);
|
|
break;
|
|
case eGameMode.Stage:
|
|
DSUtil.InActivateGameObjects(gos, 0);
|
|
gos[2].SetActive(true);
|
|
DSUtil.InActivateGameObjects(gos_ingame, 0);
|
|
gos_etc[0].SetActive(MyValue.MyChoiceMapData.n_MapID > 0);
|
|
break;
|
|
case eGameMode.MyFarm:
|
|
DSUtil.InActivateGameObjects(gos, 3);
|
|
break;
|
|
case eGameMode.Dungeon:
|
|
DSUtil.InActivateGameObjects(gos, 2);
|
|
gos_etc[0].SetActive(MyValue.MyChoiceMapData.Get_MapData().e_Dungeon == eDungeon.d4_Wave);
|
|
DSUtil.InActivateGameObjects(gos_ingame, 1);
|
|
Refresh_DungeonUI();
|
|
break;
|
|
}
|
|
|
|
m_BattleUI.Set(eUICardType.Use, ServerInfo.Ins.m_ServerData.Equip.Preset);
|
|
LoadingUI.Ins.End_Loading(1);
|
|
}
|
|
public void Refresh_DungeonUI(int addmob = 0)
|
|
{
|
|
var dungeonData = MyValue.MyChoiceMapData.Get_DungeonMapData_orNull();
|
|
if (!DSUtil.CheckNull(dungeonData))
|
|
ingame_dungeon.Set(dungeonData.f_Time, dungeonData.n_MobCount + addmob);
|
|
}
|
|
|
|
public void OnClick_Button(GameObject go)
|
|
{
|
|
switch (go.name)
|
|
{
|
|
case "btn_quick":
|
|
ShowQuick = !ShowQuick;
|
|
go.GetComponent<Animation>().Play(ShowQuick ? "UIRot_Z_0to180" : "UIRot_Z_180to0");
|
|
break;
|
|
case "btn_map": m_MapChoiceUI.Set(); break;
|
|
case "btn_setting": OptionInfo.Ins.Set(); break;
|
|
case "btn_pcinfo": m_PCUI.Set(); break;
|
|
case "btn_equipment": m_EquipmentUI.Set(); break;
|
|
case "btn_skill": m_SkillUI.Set(); break;
|
|
case "btn_pet": m_PetUI.Set(); break;
|
|
case "btn_collection": m_CollectionUI.Set(); break;
|
|
case "btn_mission": m_MissionUI.Set(); break;
|
|
case "btn_buffad": m_BuffADUI.Set(); break;
|
|
|
|
case "btn_farm": InGameInfo.Ins.Load_Map(0); break;
|
|
case "btn_btn_plantingseed": break;
|
|
case "btn_warehouse": break;
|
|
case "btn_farmer": break;
|
|
case "btn_shop": break;
|
|
case "btn_gofarm": break; // 농장 돌아다니기
|
|
|
|
case "btn_exit":
|
|
if (!DSUtil.CheckNull(FarmFarmUI.Ins) && FarmFarmUI.Ins.isActiveAndEnabled)
|
|
FarmFarmUI.Ins.ReturnToFarm();
|
|
else if (InGameInfo.Ins.IsGameMode(eGameMode.Dungeon))
|
|
DungeonInfo.Ins.Stop_Dungeon(null);
|
|
else
|
|
InGameInfo.Ins.Return_To_Lobby();
|
|
|
|
TestMapUIMgr.Ins.Set_TestBtns(false);
|
|
break;
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
case "btn_testmap":
|
|
InGameInfo.Ins.Load_Map(-99);
|
|
TestMapUIMgr.Ins.Set_TestBtns(true);
|
|
break;
|
|
#endif
|
|
}
|
|
}
|
|
public void OnClick_FarmButton(int index) { FarmMenu[index].Set(); }
|
|
} |