Skip to content

kleber-swf/Unity-Singleton-MonoBehaviour

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

Singleton MonoBehaviour for Unity Projects

Implementation of the Singleton Design Pattern to Unity MonoBehaviours. This is useful when you need a single instance of a class and wants to tweak its properties in the editor.

Features:

  • creates the Singleton instance automatically
  • Singleton is ready no matter where or when you need it in your code
  • grants the Singleton uniqueness (just one active instance at time)
  • if there is already an instance in the Scene, uses it
  • optinally makes the instance persistent through scenes

This implementation is a work in progress and it's widely open to suggestions.

More info at: http://kleber-swf.com/singleton-monobehaviour-unity-projects

About

An implementation of Singleton pattern for Unity MonoBehaviours.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages