备份CatanBuilding瘦身独立工程
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Spine.Unity;
|
||||
using UIScriptBase;
|
||||
using TMPro;
|
||||
|
||||
public partial class EventSandDigInfoPopupPanelLogic : MonoBehaviour
|
||||
{
|
||||
private RectTransform _offset;
|
||||
private GameObject _root;
|
||||
private RectTransform _reward1;
|
||||
private RectTransform _reward2;
|
||||
private RectTransform _reward3;
|
||||
private Button _close;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_offset = GetCmp<RectTransform>("root");
|
||||
_root = GetObj("root");
|
||||
_reward1 = GetCmp<RectTransform>("root/info3/bg_bar/layout_reward/Obj_reward1");
|
||||
_reward2 = GetCmp<RectTransform>("root/info3/bg_bar/layout_reward/Obj_reward2");
|
||||
_reward3 = GetCmp<RectTransform>("root/info3/bg_bar/layout_reward/Obj_reward3");
|
||||
_close = GetCmp<Button>("Btn_close");
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5660df2b101925c4a876db4dda1683be
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
75
Assets/Scripts/UIScriptBase/EventSandDigPanelLogic_Auto.cs
Normal file
75
Assets/Scripts/UIScriptBase/EventSandDigPanelLogic_Auto.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Spine.Unity;
|
||||
using UIScriptBase;
|
||||
using TMPro;
|
||||
|
||||
public partial class EventSandDigPanelLogic : BasePanel
|
||||
{
|
||||
private RectTransform _offset;
|
||||
private GameObject _root;
|
||||
private RectTransform _reward1;
|
||||
private RectTransform _reward2;
|
||||
private RectTransform _reward3;
|
||||
private RectTransform _reward4;
|
||||
private RectTransform _reward5;
|
||||
private RectTransform _finished;
|
||||
GameObject icon_ticket;
|
||||
|
||||
private RectTransform _flyReward;
|
||||
private Image _bar;
|
||||
private Image _ticket;
|
||||
private Button _questionmark;
|
||||
private Button _supply;
|
||||
private Button _confirm;
|
||||
private Button _close;
|
||||
private TextMeshProUGUI _titleName;
|
||||
private TextMeshProUGUI _time;
|
||||
private TextMeshProUGUI _num;
|
||||
private Animator _Container;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_offset = GetCmp<RectTransform>("root");
|
||||
_root = GetObj("root");
|
||||
_reward1 = GetCmp<RectTransform>("root/title/bg_bar/layout_reward/Obj_reward1");
|
||||
_reward2 = GetCmp<RectTransform>("root/title/bg_bar/layout_reward/Obj_reward2");
|
||||
_reward3 = GetCmp<RectTransform>("root/title/bg_bar/layout_reward/Obj_reward3");
|
||||
_reward4 = GetCmp<RectTransform>("root/title/bg_bar/layout_reward/Obj_reward4");
|
||||
_reward5 = GetCmp<RectTransform>("root/title/bg_bar/layout_reward/Obj_reward5");
|
||||
_finished = GetCmp<RectTransform>("root/Obj_finished");
|
||||
_flyReward = GetCmp<RectTransform>("root/Obj_flyReward");
|
||||
_bar = GetCmp<Image>("root/title/bg_bar/Img_bar");
|
||||
icon_ticket = GetObj("root/icon_ticket");
|
||||
_ticket = GetCmp<Image>("root/icon_ticket/Img_ticket");
|
||||
_questionmark = GetCmp<Button>("root/title/Btn_questionmark");
|
||||
_supply = GetCmp<Button>("root/title/Btn_supply");
|
||||
_confirm = GetCmp<Button>("root/Obj_finished/Btn_confirm/btn_green");
|
||||
_close = GetCmp<Button>("root/Btn_close");
|
||||
_titleName = GetCmp<TextMeshProUGUI>("root/title/Txt_titleName");
|
||||
_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");
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c15707d308ff469468a53a52e3accf97
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
46
Assets/Scripts/UIScriptBase/UIUtils.cs
Normal file
46
Assets/Scripts/UIScriptBase/UIUtils.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
namespace UIScriptBase
|
||||
{
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class UIUtils
|
||||
{
|
||||
public static T GetCmp<T>(Transform root, string path) where T : Component
|
||||
{
|
||||
Transform trans = GetTrans(root, path);
|
||||
if (trans != null)
|
||||
{
|
||||
return trans.GetComponent<T>();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static GameObject GetObj(Transform root, string path)
|
||||
{
|
||||
if (root != null)
|
||||
{
|
||||
Transform trans = root.Find(path);
|
||||
if (trans != null)
|
||||
{
|
||||
return trans.gameObject;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Transform GetTrans(Transform root, string path)
|
||||
{
|
||||
if (root != null)
|
||||
{
|
||||
Transform trans = root.Find(path);
|
||||
if (trans != null)
|
||||
{
|
||||
return trans;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
3
Assets/Scripts/UIScriptBase/UIUtils.cs.meta
Normal file
3
Assets/Scripts/UIScriptBase/UIUtils.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dcfd0fd6fcf24cbbbebcc60c52df5bb6
|
||||
timeCreated: 1724760462
|
||||
Reference in New Issue
Block a user