Hi all,
Not sure whether I am using the right terms but would anyone be able to explain class declarations (e.g. void, static) and access modifiers (public private)?
I am quite new to C# and I would like to know what they do and when should I use them. With examples in Unity if possible.
Thanks in advanced
You should go through unity scripting or standard C# tutorials .
โvoidโ isnโt a class declaration but is what put for a methods return type when it does not return anything. Static is a keyword used for almost everything classes, fields/properties and methods but for the most part just means you are declaring something on the class its self on not on a instance of the class.
and private and public kinda explain them selfs, if something is declared private it can only be accessed in the class where it was declared, if it is declared public it can be accessed by anything that has reference to that class.
if you dont know what private, public and void mean you really should be following some basic programming tutorials since these are some pretty basic things that you will need to understand to move forward.