Question about implementing Singletons

by tcg   Last Updated August 01, 2020 11:13 AM - source

Just came upon programming patterns and learned about singleton. I'm on the process of creating my first game and it contains several managers (see attached).I wanted to implement singleton on each of the managers,but the only way I can think is copy pasting the singleton pattern on each awake method script attached to each manager. Question would be, is there a more efficient way to do it rather than pasting the pattern on each awake method?

enter image description here

Tags : unity c#


Related Questions


Unfortunately game has stopped

Updated July 02, 2019 11:13 AM

Unity Shader-Graph randomly tiled sprite

Updated May 24, 2020 02:13 AM