Skip to content

bttfgames/SimpleGameManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimpleGameManager

A simple GameManager Class to Unity3D projects.

The SimpleGameManager class is implemented using the Singleton Pattern and uses the DontDestroyOnLoad function on the class instance. It's a enum state based class that can be used to manipulate all the game states on your projects.

Simple Usage

using UnityEngine;
using System.Collections;

public class YourClass : MonoBehaviour {

	SimpleGameManager GM;

	void Awake () {
	  // call the instance 
		GM = SimpleGameManager.Instance;
		// add a callback for when the game state changes
		GM.OnStateChange += HandleOnStateChange;
	}

	void Start(){
		Debug.Log("Started!");
		// You define all the game states on SimpleGameManager.cs class
		GM.SetGameState(GameState.YOUR_GAME_STATE);
	}

	public void HandleOnStateChange(){
		Debug.Log("State change called!");
	}
}

About

A simple GameManager Class to Unity3D projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages