IndieGame/client/Assets/Ether/Scripts/Module/Mono/MonoManager.cs

83 lines
1.7 KiB
C#
Raw Normal View History

2024-10-11 10:12:15 +08:00
/********************************************************************
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()
{
}
}
}