From 5d63560146b3f2602fe3a22321eedf5ce15cdd02 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Tue, 31 May 2022 11:52:59 +0100 Subject: [PATCH] Marked Singleton obsolete This pattern is discouraged. ... I regret adding it. --- CHANGELOG.md | 3 +++ X10D.Unity/src/Singleton.cs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ec0c8b..3cb10e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,9 @@ - X10D.Unity: Added `Vector3Int.WithZ()` - X10D.Unity: Added `Vector4.Deconstruct()` +### Changed +- X10D.Unity: Obsolesced `Singleton` + ## [3.1.0] ### Added - Reintroduced Unity support diff --git a/X10D.Unity/src/Singleton.cs b/X10D.Unity/src/Singleton.cs index 8e506db..877a43c 100644 --- a/X10D.Unity/src/Singleton.cs +++ b/X10D.Unity/src/Singleton.cs @@ -7,6 +7,8 @@ namespace X10D.Unity; /// thread-safe. /// /// The type of the singleton. +[Obsolete("This implementation of the singleton pattern is discouraged, and this class will be removed in future. " + + "DO NOT USE THIS TYPE IN PRODUCTION.")] public abstract class Singleton : MonoBehaviour where T : Singleton {