|
hi! i am trying to implement singleton class but i am totally confused. i made a class that i want to use in my project it goes something like this (this is the simplified version):
so i later on i realized that i need to have to access object of this class in more then one script and has to be the same object so the value that is set is the same. i was looking what is available in the forums and i found two resources. this one i dont understand http://www.unifycommunity.com/wiki/index.php?title=AManagerClass and this one is not working (i get "there is no instance") http://forum.unity3d.com/viewtopic.php?p=388784#388784 so i would appreciate if someone could explain how to make this work and how to use one object of this class in two separate scripts. thank you!
(comments are locked)
|
|
Here is a simple example with comments:
You get instances of the singleton as follows: Still wish I understood the importance of Classes! (Yes, I'm a noob and trying to get my head around them)!
Mar 21 '12 at 11:53 PM
mangoblue
(comments are locked)
|
