Files
DuckovMods/UIFrame/GameOriginMainMenuUI.cs

70 lines
2.0 KiB
C#
Raw Normal View History

2025-11-05 21:34:21 +08:00
using Duckov.UI;
using Duckov.Utilities;
using TMPro;
using UIFrame.Utilities;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
namespace UIFrame
{
public class GameOriginMainMenuUI
{
// public SpriteRenderer? title;
// public TMP_Text[]? allTexts;
public static Sprite? titleSprite=null;
2025-11-05 21:34:21 +08:00
// public void Initialize()
// {
// SceneManager.sceneLoaded += OnSceneLoaded;
// // SceneLoader.onAfterSceneInitialize += OnAfterSceneInitialize;
// LinkMainMenuObj();
// }
//
// public void Cleanup()
// {
// SceneManager.sceneLoaded -= OnSceneLoaded;
// // SceneLoader.onAfterSceneInitialize -= OnAfterSceneInitialize;
// }
//
// private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
// {
// Debug.Log("Loading game origin main menu...");
// LinkMainMenuObj();
// }
// // private void OnAfterSceneInitialize(SceneLoadingContext sceneLoadingContext)
// // {
// //
// // }
//
// public void LinkMainMenuObj()
// {
// var logoObj=GameObjectTool.FindObjectByPath("TimelineContent/LOGO/Logo");
// title = logoObj?.GetComponent<SpriteRenderer>();
// }
2025-11-05 21:34:21 +08:00
// public bool SetFont(TMP_FontAsset font)
// {
// if(allTexts == null || allTexts.Length == 0)
// return false;
// foreach (var text in allTexts)
// {
// text.font = font;
// }
// return true;
// }
2025-11-05 21:34:21 +08:00
public bool SetTitle(Sprite texture)
{
// Debug.Log("Setting title...");
titleSprite = texture;
// if(title==null)
// {
// return false;
// }
// title.sprite = texture;
2025-11-05 21:34:21 +08:00
return true;
}
}
}