🍬
Gummi
  • Welcome to Gummi
  • Installation
  • Repo
  • API Documentation
    • Core
      • Attributes
        • DisableIf(string Target)
        • DisableIf(string Target, object Benchmark)
        • EnableIf(string Target)
        • EnableIf(string Target, object Benchmark)
        • HideIf(string Target)
        • HideIf(string Target, object Benchmark)
        • ShowIfstring Target)
        • ShowIf(string Target, object Benchmark)
        • SOExposed
        • VisibleBaseAttribute
        • ReadOnly
      • Extensions
        • GenericExtensions
        • IntExtensions
        • ListExtensions
    • MVC
      • RootController
      • SubController
      • SubController<enum, uiView>
      • UIView
    • Singletons
      • Singleton
      • Persistent Singleton
      • Lazy Singleton
      • Persistent Lazy Singleton
    • Utility
      • MDDocumentation
      • Optional
Powered by GitBook
On this page
  • Summary
  • Fields
  • Methods
  1. API Documentation
  2. Singletons

Lazy Singleton

PreviousPersistent SingletonNextPersistent Lazy Singleton

Last updated 3 years ago

namespace: Inherits: MonoBehaviour

Summary

Base class for lazy-loaded, scene-contained Singletons. If the scene does not already contain an instance, it will create one.

Fields

public static T Instance: The instance of T in the scene. It will never be null. If there is not an instance in the scene, a new instance will be made/returned.

Methods

protected virtual void Awake(): enforces Singleton pattern.

protected virtual void OnDestroy(): sets T.Instance to null.

Gummi.Pattern.Singletons