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/simplesingleton.git

README Markdown

Copy this to your project's README.md

Style
Preview
pkglnk installs badge
## Installation

Add **Simple Singleton** to your Unity project via Package Manager:

1. Open **Window > Package Manager**
2. Click **+** > **Add package from git URL**
3. Enter:
```
https://www.pkglnk.dev/simplesingleton.git
```

[![pkglnk](https://www.pkglnk.dev/badge/simplesingleton.svg?style=pkglnk)](https://www.pkglnk.dev/pkg/simplesingleton)

README

Simple Singleton

A simple singleton implementation for Unity in UPM form for easy addition to projects.

Installation

In your Unity project open Packages/manifest.json and add "com.jimthekiwifruit.simplesingleton": "https://github.com/JimTheKiwifruit/SimpleSingleton", to the top of your dependencies:

{
  "dependencies": {
    "com.jimthekiwifruit.simplesingleton": "https://github.com/JimTheKiwifruit/SimpleSingleton.git",
    "com.unity.collab-proxy": "1.2.16",
    "com.unity.ext.nunit": "1.0.0",
    "com.unity.ide.rider": "1.0.8",
    "com.unity.ide.vscode": "1.0.7",
    ...
  }
}

You can checkout the full docs on UPM dependancies at https://docs.unity3d.com/Manual/upm-git.html

Usage

Instead of extending from MonoBehaviour, extend from Singelton<ClassName> like this:

using JimTheKiwifruit.Singleton;

public class YourClass : Singleton<YourClass> {

  void DoSomething() {
    print("Something");
  }

}

Now you can access your singleton from anywhere:

void DoStuffWithSingletonClass() {
  YourClass.Instance.DoSomething();
}

Comments

No comments yet. Be the first!