Files
Pal3.Unity/Assets/Scripts/Engine/Core/Implementation/TickableGameEntityScript.cs
T
2024-01-07 02:37:35 -08:00

33 lines
1023 B
C#

// ---------------------------------------------------------------------------------------------
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
// See LICENSE file in the project root for license information.
// ---------------------------------------------------------------------------------------------
namespace Engine.Core.Implementation
{
using UnityEngine;
public abstract class TickableGameEntityScript : GameEntityScript
{
protected virtual void OnUpdateGameEntity(float deltaTime) {}
protected virtual void OnLateUpdateGameEntity(float deltaTime) {}
protected virtual void OnFixedUpdateGameEntity(float fixedDeltaTime) {}
private void Update()
{
OnUpdateGameEntity(Time.deltaTime);
}
private void LateUpdate()
{
OnLateUpdateGameEntity(Time.deltaTime);
}
private void FixedUpdate()
{
OnFixedUpdateGameEntity(Time.fixedDeltaTime);
}
}
}