71 lines
2.5 KiB
C#
71 lines
2.5 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using UIScriptBase;
|
|
using TMPro;
|
|
|
|
public partial class EventSandDigPanelLogic : BasePanel
|
|
{
|
|
private RectTransform _offset;
|
|
private GameObject _root;
|
|
SandDigLevel[] levels;
|
|
private RewardItemNew _reward_final;
|
|
private RewardItemNew _reward1;
|
|
private RewardItemNew _reward2;
|
|
private RewardItemNew _reward3;
|
|
private RewardItemNew _reward4;
|
|
//private RectTransform _finished;
|
|
GameObject icon_ticket;
|
|
|
|
private RectTransform _flyReward;
|
|
private Image _ticket;
|
|
private Button _questionmark;
|
|
private Button _confirm;
|
|
private Button _close;
|
|
private Button _btn_add;
|
|
private TextMeshProUGUI _time;
|
|
private TextMeshProUGUI _num;
|
|
private Animator _Container;
|
|
|
|
private void Awake()
|
|
{
|
|
_offset = GetCmp<RectTransform>("root");
|
|
_root = GetObj("root");
|
|
levels = GetTrans("root/title/level").GetComponentsInChildren<SandDigLevel>(true);
|
|
_reward_final = GetCmp<RewardItemNew>("root/title/level/reward");
|
|
_reward1 = GetCmp<RewardItemNew>("root/target/reward/reward1");
|
|
_reward2 = GetCmp<RewardItemNew>("root/target/reward/reward2");
|
|
_reward3 = GetCmp<RewardItemNew>("root/target/reward/reward3");
|
|
_reward4 = GetCmp<RewardItemNew>("root/target/reward/reward4");
|
|
//_finished = GetCmp<RectTransform>("root/Obj_finished");
|
|
_flyReward = GetCmp<RectTransform>("root/Obj_flyReward");
|
|
icon_ticket = GetObj("root/icon_ticket");
|
|
_ticket = GetCmp<Image>("root/icon_ticket/Img_ticket");
|
|
_questionmark = GetCmp<Button>("root/title/Btn_questionmark");
|
|
_confirm = GetCmp<Button>("root/Obj_finished/Btn_confirm/btn_green");
|
|
_close = GetCmp<Button>("root/Btn_close");
|
|
_time = GetCmp<TextMeshProUGUI>("root/title/Txt_time");
|
|
_num = GetCmp<TextMeshProUGUI>("root/icon_ticket/Txt_num");
|
|
_Container = GetCmp<Animator>("root/Obj_finished/Btn_confirm/btn_green/Ani_Container");
|
|
_btn_add = GetCmp<Button>("root/icon_ticket");
|
|
}
|
|
private T GetCmp<T>(string path) where T : Component
|
|
{
|
|
return UIUtils.GetCmp<T>(this.transform, path);
|
|
}
|
|
private GameObject GetObj(string path)
|
|
{
|
|
return UIUtils.GetObj(this.transform, path);
|
|
}
|
|
private Transform GetTrans(string path)
|
|
{
|
|
return UIUtils.GetTrans(this.transform, path);
|
|
}
|
|
public Transform Root
|
|
{
|
|
get
|
|
{
|
|
return _offset;
|
|
}
|
|
}
|
|
}
|