把uiinfo分离到loader里面

pull/1/head
zhangxl 2024-07-19 11:03:27 +08:00
parent 359003969c
commit 4888fd3700
6 changed files with 40 additions and 29 deletions

View File

@ -1,24 +0,0 @@
using TMPro;
using UnityEngine;
namespace ZC
{
class UIInfo : MonoBehaviour
{
[SerializeField] public IUI ui;
public TMP_FontAsset font;
public void SetStart(IUI ui, TMP_FontAsset font)
{
this.ui = ui;
this.font = font;
return;
var findChildDeeps = this.transform.FindChildDeeps<TMP_Text>();
foreach (var tmpText in findChildDeeps)
{
tmpText.font = font;
}
}
}
}

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: aa6c9b462319459ca494d7979967fc65
timeCreated: 1712128595

View File

@ -71,8 +71,8 @@ namespace ZC
//#if UNITY_EDITOR
// view
var addComponent = gameObject.GetComponent<UIInfo>();
addComponent.SetStart(ui, this.font);
// var addComponent = gameObject.GetComponent<UIInfo>();
// addComponent.SetStart(ui, this.font);
//#endif
return ui;

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: c36d07c6939d47cab6cf3c3da4a0e014
timeCreated: 1721358085

View File

@ -0,0 +1,24 @@
using TMPro;
using UnityEngine;
namespace ZC
{
class UIInfo : MonoBehaviour
{
// [SerializeField] public IUI ui;
// public TMP_FontAsset font;
//
// public void SetStart(IUI ui, TMP_FontAsset font)
// {
// this.ui = ui;
// this.font = font;
//
// return;
// var findChildDeeps = this.transform.FindChildDeeps<TMP_Text>();
// foreach (var tmpText in findChildDeeps)
// {
// tmpText.font = font;
// }
// }
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d5100ab94e5c4164e9a1e9bb2ed65adb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: