Heya its me again. Trying to get some additional knowledge. I’m barely starting to work with classes and there’s a syntax I don’t quite understand. HEre’s a Unity example:
class Test extends System.Object {
var p = 5;
var c = Color.white;
}
var test = Test ();
Now why is a class often having a variable referencing the class itself? Is this so there’s only a permanent instance of the script? Is it so I can simply refer to Test.p without additionnal references? Am I totally wrong?
Also, when should I use the new keyword? I tend to just do trial and error and that makes me feel stupid,hehe.
Any hint is appreciated