- Home /
Static vs Non-Static Methods
This is one of those little basics that seems to have slipped through the cracks on me. I'm a little embarrassed to ask but, why would you declare a method static? Variables make sense, to hold a value across classes, but a method doesn't hold a value so...what would be the difference?
Answer by tanoshimi · May 18, 2015 at 06:07 PM
Static methods can be invoked without an instance of the class to which they belong. Very common for utility functions. E.g. Utility.ConvertSomethingToSomethingElse()
Here's something to help fill your crack, as it were... https://unity3d.com/learn/tutorials/modules/intermediate/scripting/statics
Your answer
Follow this Question
Related Questions
Trouble with DontDestroyOnLoad 2 Answers
Null reference exception with static method 2 Answers
Error when trying to access another script? 2 Answers
Data from a simple singleton / static class return null 1 Answer
Sending message to one object 1 Answer