@umm/singleton

1.0.0 • Public • Published

What?

  • Singleton なアクセスを可能にする static アクセサを提供します。

Why?

  • シンプルな Singleton 機構を作りたかったので作りました。

Install

$ npm install github:umm-projects/singleton

Usage

using UnityEngine;
using UnityModule;

public class SampleSingleton : Singleton<SampleSingleton> {

    public string Hoge = "ほげ";

}

public class Sample {

    public void Run() {
        Debug.Log(SampleSingleton.Instance.Hoge);
    }

}
  • Singleton<T> を継承したクラスを作るだけです。
  • <T> には作成するクラスをそのまま用います。

License

Copyright (c) 2017 Tetsuya Mori

Released under the MIT license, see LICENSE.txt

Readme

Keywords

none

Package Sidebar

Install

npm i @umm/singleton

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • kidsstar_system
  • takyama
  • risacankidsstar
  • mkaya
  • hanage
  • fakestarbaby
  • monry