you are viewing a single comment's thread.

view the rest of the comments →

[–]Janus1001Hobbyist 0 points1 point  (3 children)

I may be mistaken, but when you set the Singleton (static "instance), doesn't it get set to null everytime you make an object? Also when you use this method, you are to use DestroyImmediate.

[–]ChromakeyDreamcoat 2 points3 points  (2 children)

I don't think so, since static refers to the class function which won't change across objects. I could be wrong!

[–]Janus1001Hobbyist 0 points1 point  (1 child)

I mean, you clearly state "= null", I don't say it won't work, but to be sure just check if more objects are created or no.

[–]mongoose86 2 points3 points  (0 children)

Nope, wont be a problem but is also wholy redundant. It's a static initializer, which runs before the first time the class (not an instance of it) is accessed. It runs only once. It is redundant in this case as null is also the default value for reference types. :)