Skip to content

A view state machine for Unity3D to allow for smooth and reliable UI management and transitions.

License

Notifications You must be signed in to change notification settings

Jwho303/UnityViewState

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity View State

This Unity3D codebase provides a flexible and scalable framework for managing UI views with transition animations. The framework uses a state machine pattern to handle view states and transitions, ensuring smooth animations and transitions between different views.

Structure

Interfaces

  1. IState: Defines the interface for a state with methods to enter, update, exit, and interrupt the state.
  2. IView: Defines the interface for a view with generic view types. Inherits from IState and includes additional properties and methods specific to view animations and transitions.

Classes

  1. View: An abstract class representing a UI view. Implements IState and manages view states using a state machine (StateMachine class). Provides methods for initializing the view, setting animation clips, and handling transitions.
  2. ViewController: A class for managing multiple views. Uses a dictionary to map view types (TEnum) to IView instances. Facilitates transitioning between views.
  3. StaticState: A class representing a static state for a view. Implements IState and provides actions to perform when entering and exiting the state.
  4. TransitionState: A class representing a transition state for a view. Implements IState and manages transition animations.
  5. StateMachine: A class for managing the current state of a view. Facilitates transitioning between states and handles interruptions.

Demo

Demo.mp4

Live demo on itch.io https://jwho303.itch.io/unity-view-state

Credits

"Silent" game GUI asset set by Prinbles https://prinbles.itch.io/silent

About

A view state machine for Unity3D to allow for smooth and reliable UI management and transitions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published