Skip to content

Latest commit

 

History

History
61 lines (40 loc) · 1.27 KB

README.md

File metadata and controls

61 lines (40 loc) · 1.27 KB

com.pixelwizards.singleton

openupm

A simple Unity implementation of the Singleton software pattern.

Usage

Install via OpenUPM

The package is available on the openupm registry. It's recommended to install it via openupm-cli.

openupm add com.pixelwizards.singleton

Install via git url

Add this to your project manifest.json

"com.pixelwizards.singleton": "https://github.com/PixelWizards/com.pixelwizards.singleton.git",

OpenUPM Support

This package is also available via the OpenUPM scoped registry: https://openupm.com/packages/com.pixelwizards.singleton/

Prerequistes

  • This has been tested for >= 2018.3

Documentation

Content

Sample

Example:

public class MySingleton: Singleton { public void DoSomething() { } }

You can now reference the singleton via it's instance like so:

MySingleton.Instance.DoSomething();

Required dependencies

  • None