BITKit/Packages/Runtime/StateMachine/MonoProxy.cs

41 lines
960 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BITKit
{
public interface IMonoProxy
{
}
public class MonoProxy : Mono
{
[SerializeReference, SubclassSelector] public IMonoProxy proxy;
BehaviorUpdater updater = new();
protected override void Awake()
{
updater.Init(proxy);
updater.OnAwake();
}
protected override void Start()
{
updater.OnStart();
}
protected override void Update()
{
updater.OnUpdate(Time.deltaTime);
}
protected override void FixedUpdate()
{
updater.OnFixedUpdate(Time.fixedDeltaTime);
}
protected override void LateUpdate()
{
updater.OnLateUpdate(Time.deltaTime);
}
protected override void OnDestroy()
{
updater.OnDestroy();
}
}
}