Skip to content

Deaglis1197/Life-Cycle-Asset

Repository files navigation

Life-Cycle-Asset

This pattern builded on these two scripts, these are Sequence Manager and UI Manager. These two scripts running independence each other. They use singneleton so you can access any where easily.


Sequence Manager

  • Manage all game state in this script.
  • Managing game states with State Machine.
  • Only one game state running and change this state when you want easily.
  • All game state registered on this script with Unity Serializefield.
  • All game state has OnStart and OnExit.

Eventually all game circle living on this script. For example, when the game complete, InGame state switch to GameOver state so game is over.

UI Manager

  • Manage all UI Canvas in this script.
  • All UI Canvas registered on this script with Unity Serializefield.
  • Enable and Disable all UI Canvas on this script.
  • Enable two or more UI Canvas at the same time is allowed.
  • Access all canvas through this script.
  • All Canvases has OnEnabled and OnDisabled.

UI Manager can work with together Sequence Manager, For example when player wants to open pause menu, game state change to pause, at the same time, InGame Canvas Disable and after that Pause Canvas Enable.

This pattern applied on basic runner game for explain how is working.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published