// Classes are where you store the main program e.g. fields, methods, etc.
// Here are some types of classes: Partial, Private, Public, Sealed, Static.
public class MyClass
{
// Fields
public int myInt = 4;
public int myNextInt = 6;
public int result;
public bool myBool = false;
// Methods
public void MyMethod()
{
// Method program
if (!myBool)
{
result = myInt + myNextInt
Debug.Log(result)
}
}
}
/* Any class member that is set to private can only be accessed by other members of
that same class. Public classes have the opposite affect. */
public class Stuff
{
public int bullets;
public int grenades;
public int rockets;
public Stuff(int bul, int gre, int roc)
{
bullets = bul;
grenades = gre;
rockets = roc;
}
}