IndieGame/client/Assets/Ether/Scripts/Module/Mono/MonoManager.cs
DOBEST\zhaoyingjie f242607587 初始化工程
2024-10-11 10:12:15 +08:00

83 lines
1.7 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/********************************************************************
文件MonoManager.cs
作者:梦语
邮箱1982614048@qq.com
日期2024/02/19 14:26:48
功能:
*********************************************************************/
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Ether
{
public class MonoManager : SingletonAutoMono<MonoManager>
{
#region Update
private Action updateAction;
private Action lateUpdateAction;
private Action fixedUpdateAction;
public void AddUpdateListener(Action update)
{
updateAction += update;
}
public void RemoveUpdateListener(Action update)
{
updateAction += update;
}
public void AddLateUpdateListener(Action lateUpdate)
{
lateUpdateAction += lateUpdate;
}
public void RemoveLateUpdateListener(Action lateUpdate)
{
lateUpdateAction += lateUpdate;
}
public void AddFixedUpdateListener(Action fixedUpdate)
{
fixedUpdateAction += fixedUpdate;
}
public void RemoveFixedUpdateListener(Action fixedUpdate)
{
fixedUpdateAction += fixedUpdate;
}
public void Update()
{
updateAction?.Invoke();
}
public void LateUpdate()
{
lateUpdateAction?.Invoke();
}
public void FixedUpdate()
{
fixedUpdateAction?.Invoke();
}
#endregion
public override void Init()
{
}
public override void Clear()
{
}
}
}