83 lines
1.7 KiB
C#
83 lines
1.7 KiB
C#
/********************************************************************
|
||
文件: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()
|
||
{
|
||
|
||
}
|
||
|
||
}
|
||
}
|