架构大更
This commit is contained in:
@@ -1,45 +1,45 @@
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
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("Settings")] [SerializeField] private UIManager UIManagerAsset;
|
||||
|
||||
[HideInInspector] public bool overrideColors;
|
||||
[HideInInspector] public bool overrideFonts;
|
||||
|
||||
[Header("Resources")] [SerializeField] private Image background;
|
||||
|
||||
[Header("Resources")]
|
||||
[SerializeField] private Image background;
|
||||
[SerializeField] private Image icon;
|
||||
[SerializeField] private TextMeshProUGUI title;
|
||||
[SerializeField] private TextMeshProUGUI description;
|
||||
|
||||
void Awake()
|
||||
private void Awake()
|
||||
{
|
||||
if (UIManagerAsset == null) { UIManagerAsset = Resources.Load<UIManager>("MUIP Manager"); }
|
||||
if (UIManagerAsset == null) UIManagerAsset = Resources.Load<UIManager>("MUIP Manager");
|
||||
|
||||
this.enabled = true;
|
||||
enabled = true;
|
||||
|
||||
if (UIManagerAsset.enableDynamicUpdate == false)
|
||||
if (!UIManagerAsset.enableDynamicUpdate)
|
||||
{
|
||||
UpdateNotification();
|
||||
this.enabled = false;
|
||||
enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
private void Update()
|
||||
{
|
||||
if (UIManagerAsset == null) { return; }
|
||||
if (UIManagerAsset.enableDynamicUpdate == true) { UpdateNotification(); }
|
||||
if (UIManagerAsset == null) return;
|
||||
if (UIManagerAsset.enableDynamicUpdate) UpdateNotification();
|
||||
}
|
||||
|
||||
void UpdateNotification()
|
||||
private void UpdateNotification()
|
||||
{
|
||||
if (overrideColors == false)
|
||||
if (!overrideColors)
|
||||
{
|
||||
background.color = UIManagerAsset.notificationBackgroundColor;
|
||||
icon.color = UIManagerAsset.notificationIconColor;
|
||||
@@ -47,7 +47,7 @@ namespace Michsky.MUIP
|
||||
description.color = UIManagerAsset.notificationDescriptionColor;
|
||||
}
|
||||
|
||||
if (overrideFonts == false)
|
||||
if (!overrideFonts)
|
||||
{
|
||||
title.font = UIManagerAsset.notificationTitleFont;
|
||||
title.fontSize = UIManagerAsset.notificationTitleFontSize;
|
||||
|
||||
Reference in New Issue
Block a user