mirror of
https://github.com/0x7c13/Pal3.Unity.git
synced 2026-11-26 17:38:10 +08:00
33 lines
1014 B
C#
33 lines
1014 B
C#
// ---------------------------------------------------------------------------------------------
|
|
// Copyright (c) 2021-2024, Jiaqi 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);
|
|
}
|
|
}
|
|
} |