Unclaimed Package Is this your package? Claim it to unlock full analytics and manage your listing.
Claim This Package

Install via UPM

Add to Unity Package Manager using this URL

https://www.pkglnk.dev/track/fredericrp-singleton.git

README

openupm

Generic Singleton

Generic version of singleton for both MonoBehaviour and Standard classes.

Singleton is a development pattern that prevents having multiple instances of the same component in a scene. It allows also any script to access this one wihout requiring a manual link between the two.

This one is a generic Singleton that allows you to inherit from it from your class to access its instance with the static Instance property. There are two singleton:

  • Singleton that inherits from MonoBehaviour
  • SimpleSingleton that does not

Usage

Extends the Singleton<T> (for MonoBehaviour singletons) or SimpleSingleton<T> (for standard classes singletons) class from your own classes like this:

public class MyBrandNewClass : Singleton<MyBrandNewClass> {
// ... fields, methods, etc.
}

You can call it from other scripts like this :

MyBrandNewClass.Instance.PublicMethod()

See Transition class for a demo.

Total Installs
0
Last 30 days
Unique IPs
0
Approximate users

Installs Over Time

Operating Systems

No data yet

Top Countries

No data yet

Git Versions

No data yet

Embed Install Badge

Add an install count badge to your README

Style
Preview
pkglnk installs badge
Markdown
[![pkglnk installs](https://www.pkglnk.dev/badge/fredericrp-singleton.svg?style=pkglnk)](https://www.pkglnk.dev/pkg/fredericrp-singleton)
HTML
<a href="https://www.pkglnk.dev/pkg/fredericrp-singleton"><img src="https://www.pkglnk.dev/badge/fredericrp-singleton.svg?style=pkglnk" alt="pkglnk installs"></a>

Comments

No comments yet. Be the first!