The CustomFixedUpdate repository contains scripts that extend Unity's PlayerLoop to implement a custom fixed update system with adjustable update periods. This system allows developers to define their own fixed update logic and dynamically change the update period during runtime.
- CustomFixedUpdate Script: Implements a custom fixed update system that triggers at specified intervals.
- PeriodClr Script: Provides a MonoBehaviour script for toggling between two different update periods for the custom fixed update system.
- PlayerLoopExt Class: Extends Unity's PlayerLoop to integrate the custom fixed update system seamlessly into the game's update loop.
- Optimized Code: Scripts are optimized for performance and readability to ensure efficient execution and easy maintenance.
- Clone or download the repository.
- Import the provided scripts into your Unity project.
- Attach the
PeriodClr
script to a GameObject in your scene to control the update period dynamically. - Customize the fixed update logic in the
PlayerLoopExt
class according to your project requirements. - Use
PlayerLoopExt.SetUpdatePeriod(period)
to set the update period programmatically if needed.
- Attach the
PeriodClr
script to a GameObject in your scene. - Press the space key during gameplay to toggle between two different update periods for the custom fixed update system.