Created
October 25, 2022 20:34
-
-
Save saitocastel1900/d91026e2aece4c6f1864545b9c3aa8d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static readonly object Lock = new object(); | |
private static Singleton3 _instance; | |
public static Singleton3 Instance | |
{ | |
get | |
{ | |
lock (Lock) | |
{ | |
return _instance ??= new Singleton3(); | |
} | |
} | |
} | |
public string Name { get; } | |
private Singleton3() | |
{ | |
Name = nameof(Singleton3); | |
Debug.Log("コンストラクターが呼び出されました"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment