NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Framework/UI/UIRoot.cs

74 lines
1.8 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using UnityEngine;
using UnityEngine.UI;
using Object = UnityEngine.Object;
using PhxhSDK;
public partial class UIRoot : SingletonMono<UIRoot>
{
public Canvas RootCanvas;
// 所有UI的根节点
public GameObject Root;
/// <summary>
/// UI相机在场景中设置由CameraManager统一管理
/// </summary>
public Camera UICamera;
/// <summary>
/// UI Top相机在场景中设置由CameraManager统一管理
/// </summary>
public Camera UITopCamera;
// 尝试修复花屏的问题
bool isDirty = false;
Font dirtyFont = null;
private void Awake()
{
DontDestroyOnLoad(this);
}
/// <summary>
/// 是否激活射线检测
/// </summary>
/// <param name="isEnable"></param>
public void IsEnableGraphicRaycaster(bool isEnable)
{
GraphicRaycaster graphicRaycaster = Root.GetComponent<GraphicRaycaster>();
if (graphicRaycaster is null)
return;
graphicRaycaster.enabled = isEnable;
}
/// <summary>
/// 新手引导是否激活射线检测(新手引导用)
/// </summary>
/// <param name="isEnable"></param>
public void IsEnableGraphicRaycasterByGuide(bool isEnable)
{
foreach (var kv in UIManager.Instance.mMemoryWindows)
{
if (UINameConst.UIFightScene == kv.Key)
continue;
if (UINameConst.UINoticeOne == kv.Key)
continue;
if (UINameConst.UINoticeTwo == kv.Key)
continue;
if (UINameConst.UI_GuideTip == kv.Key)
continue;
if (UINameConst.UI_Guide == kv.Key)
continue;
kv.Value.GraphicRaycasterManager.IsEnableGraphicRaycaster = isEnable;
}
}
}