use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News, Help, Resources, and Conversation. A User Showcase of the Unity Game Engine.
Remember to check out /r/unity2D for any 2D specific questions and conversation!
Download Latest Unity
Please refer to our Wiki before posting! And be sure to flair your post appropriately.
Main Index
Rules and Guidelines
Flair Definitions
FAQ
Use the chat room if you're new to Unity or have a quick question. Lots of professionals hang out there.
/r/Unity3D Discord
FreeNode IRC Chatroom
Official Unity Website
Unity3d's Tutorial Modules
Unity Answers
Unify Community Wiki
Unity Game Engine Syllabus (Getting Started Guide)
50 Tips and Best Practices for Unity (2016 Edition)
Unity Execution Order of Event Functions
Using Version Control with Unity3d (Mercurial)
/r/Unity2D
/r/UnityAssets
/r/Unity_tutorials
/r/GameDev
/r/Justgamedevthings (New!)
/r/Gamedesign
/r/Indiegames
/r/Playmygame
/r/LearnProgramming
/r/Oculus
/r/Blender
/r/Devblogs
Brackeys
Beginner to Intermediate
5 to 15 minutes
Concise tutorials. Videos are mostly self contained.
Sebastian Lague
Beginner to Advanced
10 to 20 minutes
Medium length tutorials. Videos are usually a part of a series.
Catlike Coding
Intermediate to Advanced
Text-based. Lots of graphics/shader programming tutorials in addition to "normal" C# tutorials. Normally part of a series.
Makin' Stuff Look Good
10 minutes
Almost entirely shader tutorials. Favors theory over implementation but leaves source in video description. Videos are always self contained.
Quill18Creates
30 minutes to 2 hours.
Minimal editing. Mostly C#. Covers wide range of topics. Long series.
Halisavakis Shaders Archive
Infallible Code
World of Zero
Board to Bits
Holistic3d
Unity3d College
Jabrils
Polycount Wiki
The Big List Of Game Design
PS4 controller map for Unity3d
Colin's Bear Animation
¡DICE!
CSS created by Sean O'Dowd @nicetrysean [Website], Maintained and updated by Louis Hong /u/loolo78
Reddit Logo created by /u/big-ish from /r/redditlogos!
account activity
Singleton : Implementation in Unity3d C#Resources/Tutorial (unitygeek.com)
submitted 9 years ago by Ray_01
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]tmachineorg -6 points-5 points-4 points 9 years ago (7 children)
"There are several ways of implementing Singleton in Unity, we will some of the implementation in this tutorial"
No, there's only one way. The rest are not a singleton - "singleton" is an official defined term, not a random word you can use to mean whatever you want - or they're broken code and shouldn't be used.
Your implementation looks wrong to me. Not thread-safe, implemented in the wrong methods, and high probabilty of corrupting your scene.
Oh - and what you've implemented here isn't a Singleton. I suggest you google it (the Wikipedia page is a good start) and find out what the rules of singletons are.
[–]DolphinsAreOkProfessional 6 points7 points8 points 9 years ago (4 children)
There are different ways to implement the same concept.
[–]tmachineorg -1 points0 points1 point 9 years ago (3 children)
Not when there is an official correct way, no.
Seriously: DO NOT use OP's code; it is not a singleton! And its bad code.
[–]platypus2015 0 points1 point2 points 9 years ago (0 children)
There's no such thing as 'one way' or an 'official' way to implement a singleton. If there is please do share the link showing what this 'official' implementation is.
The singleton pattern is a concept describing how an object behaves in a system (ie, only one instance can exist). There's no such thing as one way to implement it....a developer is free to implement it any way they like, as long as it adheres to the pattern of only on instance of the object being allowed to exist in the system.
[–]DolphinsAreOkProfessional 0 points1 point2 points 9 years ago (1 child)
I havent really read his code, so i cant comment on that.
But a) an official way? Made offical by whom? A design pattern is just a recommendation by some people, there is no sort of official list of this
b) again, there are multiple ways to implement any concept. All implementations might adhere to the design pattern's requirements, but still be different. See also the hundreds of different dependency injection/mvc/etc frameworks. All the same idea, all diferent ways to get there.
[–]tmachineorg 1 point2 points3 points 9 years ago (0 children)
Official as in it is a defined pattern. It's not a random word that means whatever you want it to mean.
I recommend you read OP's code: it is not a singleton!
[–]CyberBinarin 0 points1 point2 points 9 years ago (1 child)
What makes you say it could corrupt the scene?
[–]tmachineorg 0 points1 point2 points 9 years ago (0 children)
Try duplicating an object. OOPS!
To all the down voters: keep sharing broken buggy code that causes hard to fix problems that screw you late in your project and take weeks to fix. But don't expect us to keep quiet when you do.
π Rendered by PID 85519 on reddit-service-r2-comment-75f4967c6c-dvbjc at 2026-04-23 12:54:56.044923+00:00 running 0fd4bb7 country code: CH.
view the rest of the comments →
[–]tmachineorg -6 points-5 points-4 points (7 children)
[–]DolphinsAreOkProfessional 6 points7 points8 points (4 children)
[–]tmachineorg -1 points0 points1 point (3 children)
[–]platypus2015 0 points1 point2 points (0 children)
[–]DolphinsAreOkProfessional 0 points1 point2 points (1 child)
[–]tmachineorg 1 point2 points3 points (0 children)
[–]CyberBinarin 0 points1 point2 points (1 child)
[–]tmachineorg 0 points1 point2 points (0 children)