Singletons & Managers - Unity Tutorial by Roundbeargames

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@roundbeargames·
0.000 HBD
Singletons & Managers - Unity Tutorial by Roundbeargames
[![378lpu.png](https://img.esteem.app/378lpu.png)](https://youtube.com/roundbeargames)

----

https://youtu.be/92NQVeFiDeY

Singletons Explained
Unity Tutorial by Roundbeargames

Usually the use of singletons is not recommended, but for a simple indie game, it might be ok as long as you don't overdo it.

Personally, I like to use singletons to hold a list of a group of objects: 
- Character Manager for example, has the list of all the characters in the scene
- Virtual Input Manager has all the public variables for possible presses like up, down, left, right, etc).

From any class, you can access the Character Manager by using "CharacterManager.Instance" or the Virtual Input Manager through "VirtualInputManager.Instance". You don't have to worry about instantiating a manager class. It's done automatically the first time you call the public method.

Singletons:
https://en.wikipedia.org/wiki/Singleton_pattern

Static variables:
https://en.wikipedia.org/wiki/Static_variable

Unity3D Managers vs Controllers:
https://youtu.be/T39tyyQjFSQ

C# Generics:
https://youtu.be/5ds30gSotPc

Files are available here:
https://drive.google.com/drive/folders/17Lfpa5r-3zeR1jaT0eJ4nqIR3pkU9ABE?usp=sharing

Download this project: 
https://github.com/RoundBearChoi/2.5D_Platformer_Unity

Tutorial playlist:
https://www.youtube.com/playlist?list=PLWYGofN_jX5BupV2xLjU1HUvujl_yDIN6

Any questions/comments? Join us on discord: 
https://discord.gg/RbxjBu3

Social
twitter: https://twitter.com/roundbeargames
facebook: https://facebook.com/roundbeargames17
steem: https://steemit.com/@roundbeargames
reddit: https://reddit.com/user/roundbeargames
linkedin: https://linkedin.com/in/roundbeargames-choi-15041a9a

Patreon:
https://patreon.com/roundbeargames

----

<center>

[![rblogo_up.png](https://cdn.steemitimages.com/DQmbGCND6J3XWjZuLbEmYVPtNwPNGNGZ5LYBYa1jSp3rCG6/rblogo_up.png)](https://steemit.com/@roundbeargames)
  
[![40_flogo_rgb_hex-brc-site-250.png](https://cdn.steemitimages.com/DQmThw7FJqwZR9axYs7TnsJdbu7iqo9zq1FhTLaSDqWMShd/40_flogo_rgb_hex-brc-site-250.png)](https://www.facebook.com/RoundBearGames17) [![40_ytlogo50.png](https://cdn.steemitimages.com/DQmZwv7R6QendHUsLf6216uu8Cp2w7MLAv6gByKSuxCxzHD/40_ytlogo50.png)](https://www.youtube.com/channel/UCAoJgVzDHnFDOQwC42raByg) [![40_twitter-logo-transparent-300x300.png](https://cdn.steemitimages.com/DQmaEWJVXdDvW9fXe2wAM6YzEbM81EoR7cewFCpV7AXw9vj/40_twitter-logo-transparent-300x300.png)](https://twitter.com/RoundBearGames) [![Discord-Logo-Color_40w.png](https://cdn.steemitimages.com/DQmRzuhdEeNaTzSGzbniP2366yLLoLBiMytiFTXZGJBEWQs/Discord-Logo-Color_40w.png)](https://discord.gg/RbxjBu3) [![steemitlogo_tr_35.png](https://cdn.steemitimages.com/DQmZn17ozfcwX6zrrToopdkFbsNWU7CBq1J2JtWC41sAc8e/steemitlogo_tr_35.png)](https://www.steemit.com/@roundbeargames) [![Whaleshares-Logo copy-32.png](https://cdn.steemitimages.com/DQmRAPKNgQR9Lwft68DHT5e3dkBXfX3bw7Er1A1Bz7bMGMq/Whaleshares-Logo%20copy-32.png)](https://whaleshares.io/@roundbeargames) [![reddit 33.png](https://cdn.steemitimages.com/DQmUumcXT8QNt24J6FcMvL8tbyHcu22opbxgF2KySp43sj5/reddit%2033.png)](https://www.reddit.com/user/roundbeargames) [![linkedin32.png](https://cdn.steemitimages.com/DQmUjeR1NKESYntbqhShPga1huvHeJrQ46VoSmXkU2X9Qo9/linkedin32.png)](https://www.linkedin.com/in/roundbeargames-choi-15041a9a/)
<br>
#### Posted using [eSteem Surfer](https://esteem.app)
![mascot_logo_100.png](https://cdn.steemitimages.com/DQmRtCRvnh6DN278Shi3TCJH4xb8GCv3vdkVDZcccxUPMy4/mascot_logo_100.png)
</center>
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,