基础内容
必要插件安装 缓动曲线和动画基础 ElementFolder,Track与其次级模块,PathNode重构
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class UIManagerNotification : MonoBehaviour
|
||||
{
|
||||
[Header("Settings")]
|
||||
[SerializeField] private UIManager UIManagerAsset;
|
||||
[HideInInspector] public bool overrideColors = false;
|
||||
[HideInInspector] public bool overrideFonts = false;
|
||||
|
||||
[Header("Resources")]
|
||||
[SerializeField] private Image background;
|
||||
[SerializeField] private Image icon;
|
||||
[SerializeField] private TextMeshProUGUI title;
|
||||
[SerializeField] private TextMeshProUGUI description;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (UIManagerAsset == null) { UIManagerAsset = Resources.Load<UIManager>("MUIP Manager"); }
|
||||
|
||||
this.enabled = true;
|
||||
|
||||
if (UIManagerAsset.enableDynamicUpdate == false)
|
||||
{
|
||||
UpdateNotification();
|
||||
this.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (UIManagerAsset == null) { return; }
|
||||
if (UIManagerAsset.enableDynamicUpdate == true) { UpdateNotification(); }
|
||||
}
|
||||
|
||||
void UpdateNotification()
|
||||
{
|
||||
if (overrideColors == false)
|
||||
{
|
||||
background.color = UIManagerAsset.notificationBackgroundColor;
|
||||
icon.color = UIManagerAsset.notificationIconColor;
|
||||
title.color = UIManagerAsset.notificationTitleColor;
|
||||
description.color = UIManagerAsset.notificationDescriptionColor;
|
||||
}
|
||||
|
||||
if (overrideFonts == false)
|
||||
{
|
||||
title.font = UIManagerAsset.notificationTitleFont;
|
||||
title.fontSize = UIManagerAsset.notificationTitleFontSize;
|
||||
description.font = UIManagerAsset.notificationDescriptionFont;
|
||||
description.fontSize = UIManagerAsset.notificationDescriptionFontSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user