- Home /
Question about new classes in 5
Hey guys, back in 4 you called a class by
GameManager gamManager = new GameManager();
gameManager.foo = bar;
Now I noticed you can just call,
GameManager.foo = bar;
without declaring it, is this new practice? Or should I go back to the old way?
Is foo a static member of your class? This doesn't really have anything to do with Unity 5 so much as how you've written your Game$$anonymous$$anager class.
Yes, I got warnings when I was assigning a member of $$anonymous$$onoBehaviour the new declaration.
I am asking if this is the way we call functions now, without declaring them first.
You can't create a $$anonymous$$onoBehaviour using "new". This is not a change in Unity 5, it's how it has always been.
Answer by Eric5h5 · Aug 15, 2015 at 01:15 AM
Nothing has changed regarding programming languages in Unity 5. Everything is exactly the same as it was in Unity 4, and there's nothing new.