54 lines
1.4 KiB
C#
54 lines
1.4 KiB
C#
|
|
using System;
|
||
|
|
using System.Collections;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
public class DeckTabUI : MonoBehaviour
|
||
|
|
{
|
||
|
|
public GameObject[] gos_tab_on, gos_tab_off;
|
||
|
|
public GameObject go_desc;
|
||
|
|
|
||
|
|
string CurTab = "1";
|
||
|
|
int iCurTab = 0;
|
||
|
|
Action act_SetUI;
|
||
|
|
bool DeckDescAbove;
|
||
|
|
|
||
|
|
public void Set(int _chapter, Action _SetUI, bool deckdescposisabove)
|
||
|
|
{
|
||
|
|
OnClick_BackDeckDesc();
|
||
|
|
act_SetUI = _SetUI;
|
||
|
|
DeckDescAbove = deckdescposisabove;
|
||
|
|
|
||
|
|
var sdata = ServerInfo.Ins.m_ServerData;
|
||
|
|
//CurTab = sdata.Equip.Get_Preset_byChapter(_chapter);
|
||
|
|
iCurTab = int.Parse(CurTab) - 1;
|
||
|
|
Set_Tab();
|
||
|
|
}
|
||
|
|
|
||
|
|
void Set_Tab()
|
||
|
|
{
|
||
|
|
DSUtil.InActivateGameObjects(gos_tab_on, iCurTab);
|
||
|
|
DSUtil.ActivateGameObjects(gos_tab_off, iCurTab);
|
||
|
|
act_SetUI();
|
||
|
|
}
|
||
|
|
|
||
|
|
public string Get_Tab() { return CurTab; }
|
||
|
|
|
||
|
|
public void OnClick_Tab(GameObject _go)
|
||
|
|
{
|
||
|
|
CurTab = _go.name;
|
||
|
|
iCurTab = int.Parse(CurTab) - 1;
|
||
|
|
Set_Tab();
|
||
|
|
}
|
||
|
|
public void OnClick_DeckDesc()
|
||
|
|
{
|
||
|
|
go_desc.SetActive(true);
|
||
|
|
go_desc.transform.localPosition = DeckDescAbove ? Vector3.up * 229f : Vector3.up * 80f;
|
||
|
|
BackKeyMgr.Ins.Add_Back(OnClick_BackDeckDesc);
|
||
|
|
}
|
||
|
|
public void OnClick_BackDeckDesc()
|
||
|
|
{
|
||
|
|
go_desc.SetActive(false);
|
||
|
|
BackKeyMgr.Ins.Del_Back(OnClick_BackDeckDesc);
|
||
|
|
}
|
||
|
|
}
|