Hi everyone, reading CarController.cs in the Standard Assets, I’ve realized that the author writes all the fields he wanna be shown in the inspector in this way:
[SerializeField] private CarDriveType m_CarDriveType = CarDriveType.FourWheelDrive;
[SerializeField] private WheelCollider[] m_WheelColliders = new WheelCollider[4];
[SerializeField] private GameObject[] m_WheelMeshes = new GameObject[4];
[SerializeField] private WheelEffects[] m_WheelEffects = new WheelEffects[4];
[SerializeField] private Vector3 m_CentreOfMassOffset;
[SerializeField] private float m_MaximumSteerAngle;
Why this long line of code, when the result can be similar only by:
public CarDriveType m_CarDriveType = CarDriveType.FourWheelDrive;
public WheelCollider[] m_WheelColliders = new WheelCollider[4];
public GameObject[] m_WheelMeshes = new GameObject[4];
public WheelEffects[] m_WheelEffects = new WheelEffects[4];
public Vector3 m_CentreOfMassOffset;
public float m_MaximumSteerAngle;
Just for private access?