Learn to Program with C# - SINGLETON DESIGN - Intermediate Unity Tutorial

preview_player
Показать описание

🔥 *FREE Goodies* 🔥

🌐 *Connect with Us* 🌐

Рекомендации по теме
Комментарии
Автор

Mind BLOWN! I never thought of doing this. super useful man. These are the best game programming tutorials for unity and just C# in general around. I feel like I learn more in 10minutes of your tutorials than most 1-2 hour lectures.

ZacVrono
Автор

So happy I found your channel, I watch these when I travel to work and whenever I get time too. It's coding in plain English, which makes it so easy to understand. I never understood properties and singleton until I watched this tutorial. Thanks, Jon!

unkindled_dreg
Автор

Great video! Now I really understand this concept of Singleton thanks to this video.

CGI_Patrice
Автор

Just noticed that you replied to every comment so just wanted to say Hi and of course thanks for your amazing videos :)

priyeshjain
Автор

Sitting up at night doing your lesson at 6:41 I almost jumped when there was a sudden loud sound. Please don't do that again ))

oleksandrshvets
Автор

NO LONG INTRO JUST STRAIGHT FORWARD VERY EASY TO UNDERSTAND.

PolylabStudio
Автор

I'll be honest, I'm a really lazy guy, that does not have a lot of time, but thanks to this video, I managed to understand this pattern. Thank you for that.

gmostechnologicalvlo
Автор

great video series. great complement to unity's courses

trvorx
Автор

How are these different then just using static variables on a manager script?

timmydube
Автор

Singleton is powerful pattern that must learn as soon as i started to develop game with any engine. So, why dont you make a separate topic to talk about design pattern  and which one common use when you code Unity ? I know that way maybe not help someone can make a game quickly. But i think that can optimize system when we take large project.
Anyway, i appreciate your tutorial .It encourage newbie eager to learn Unity.

ngoquoctruong
Автор

Great video but this code.. "GameManager.Instance.Score" isn't it a little long and complicated to just get the score variable ?

aliozer
Автор

Hey John, great example of the Singleton pattern. My only concern is that in order to make use of it in a script e.x GameManager. Any serialized fields, lets say a gameobject prefab will have a null value if if the GameManager Instance is created through the approach you suggested of a new gameobject and attaching the script to it. I ended up using a UnitSpawn Manager that was instantiated in the scene in order to update the values I needed but I wonder if there is a better work around. Thank you in advance and also congrats on your Udemy courses, I am really enjoying it!

soonfamous
Автор

private and only one instance right? the first step ? what's is the relationship with abstract class, I learning basic and intermediatly codes years ago but I stopped it to learn, and now this year I strting again, not by 0, I started with class and arrays. thx!! you are very didactic with strong fundamentals!

leatherandpoemscharmyman
Автор

Great tutorial, one question though, can this be done using private fields instead of public? im trying to get a score system across multiple scenes of a platformer for a college assessment but i have to keep all class-wide variables private.

TwistdRabbit
Автор

Excellent video, thank you! I have one question about this that has me a little bit confused. I don't quite get how a game in unity is composed of multiple different scenes, and how the game manager interacts with those scenes. Do you need to have the game manager script exist as an object in every single scene? Or is there a different way to handle this?

Thanks!

bryanwulzen
Автор

Hi, great video! I have a question: is lazy instantiation the only benefit to using the singleton pattern for managers over, for example, static classes? Or are there any other significant benefits?

Twinji
Автор

You need to lock the thread if the instance is not null in case of multi-threading otherwise it will not be thread safe.

springfield-videos
Автор

Amazing playlist! Subscribing for more unity programming stuff!

whatevsimbulletproof
Автор

PLEASE ADD A COMMENT IN THE VIDEO THAT YOU MUST ADD THIS TO THE AWAKE FUNCTION = DontDestroyOnLoad(this); because if you dont add that code you will instance over all the scenes and the values of the variables will be reset I almost get crazy but I figure it out, thanks for the video I wrote all the code you preset on it and helps me a lot!!

danielguevara
Автор

do you typically do this with the Player class too? Since there is only 1 player class ?

VTOCHIN
visit shbcf.ru