Click or drag to resize
SingleInstanceT Class
Singleton for MonoBehaviours. Creates a game object for your component if no instance is found.
Inheritance Hierarchy
SystemObject
  Object
    Component
      Behaviour
        MonoBehaviour
          spaar.ModLoaderSingleInstanceT
            spaar.ModLoaderGame
            spaar.ModLoaderMachineData
            spaar.ModLoaderOptionsMenu
            spaar.ModLoaderSettingsMenu
            spaar.ModLoader.UIModGUI

Namespace: spaar.ModLoader
Assembly: SpaarModLoader (in SpaarModLoader.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public abstract class SingleInstance<T> : MonoBehaviour
where T : SingleInstance<T>

Type Parameters

T
The class you want to make a singleton

The SingleInstanceT type exposes the following members.

Constructors
  NameDescription
Protected methodSingleInstanceT
Initializes a new instance of the SingleInstanceT class
Top
Properties
  NameDescription
Public propertyStatic memberInstance
Return the single instance. If none exists, a new game object is created and the component is added to it.
Public propertyName
Name of the game object this will be attached to.
Top
Methods
  NameDescription
Public methodStatic memberInitialize
Create an instance if none exists already.
Top
See Also