Feat: 场景视图mod,UI框架更换标题
This commit is contained in:
40
MyMainMenu/ModBehaviour.cs
Normal file
40
MyMainMenu/ModBehaviour.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace MyMainMenu
|
||||
{
|
||||
public class ModBehaviour:Duckov.Modding.ModBehaviour
|
||||
{
|
||||
public GameMainTitle gameMainTitle=new GameMainTitle();
|
||||
|
||||
void Awake()
|
||||
{
|
||||
SceneManager.sceneLoaded += OnSceneLoaded;
|
||||
}
|
||||
void OnDestroy()
|
||||
{
|
||||
SceneManager.sceneLoaded -= OnSceneLoaded;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
gameMainTitle.Update();
|
||||
}
|
||||
|
||||
protected override void OnAfterSetup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void OnBeforeDeactivate()
|
||||
{
|
||||
|
||||
}
|
||||
void OnSceneLoaded(Scene scene, LoadSceneMode mode)
|
||||
{
|
||||
gameMainTitle.Initialize();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user