40 lines
1.3 KiB
C#
40 lines
1.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using ZXK.Framework;
|
|
using ZXK.UTility;
|
|
/*******************************************************************************
|
|
*Create By CG
|
|
*Function 每个UI界面预制体资源
|
|
*******************************************************************************/
|
|
namespace ZXK.BYSS
|
|
{
|
|
public class UIModel
|
|
{
|
|
private Dictionary<string, GameObject> _uiData = new Dictionary<string, GameObject>();
|
|
public Dictionary<string, GameObject> _UiData { get => _uiData; }
|
|
|
|
///// <summary>
|
|
///// 初始化数据
|
|
///// </summary>
|
|
public void InitData()
|
|
{
|
|
AddressablesManager.Instance.LoadAssets<GameObject>("ui", OnLoadedCall);
|
|
|
|
}
|
|
|
|
private void OnLoadedCall(List<GameObject> objs)
|
|
{
|
|
for (int i = 0; i < objs.Count; i++)
|
|
{
|
|
_uiData.Add(objs[i].name, objs[i]);
|
|
}
|
|
//AppManagement.Instance.EnterProcess(EnumCtrl.Model.Home);
|
|
|
|
Transform topCanvas = GameObject.FindGameObjectWithTag("MainCanvas").transform.parent.Find("TopCanvas");
|
|
UI_Manage.Instance.ShowPanel("HoverPanel", 0, topCanvas);
|
|
|
|
AppManagement.Instance.ChangeModel(EnumCtrl.Model.Home);
|
|
}
|
|
}
|
|
} |