I wouldn’t say it’s out of line, it’s just that we’re talking about a LOT of data structures, and not all of the information comes from the same places. Also, some of these structures will change as the courses progress (as we add features in each course.) I’ll try to work up a full list of the structures as they exist at the end of the four courses (I simply don’t have the time it would take to run through the evolution of the structures), and I’ll post them against this topic. Be patient, they won’t all be today.
I’m also from the old school, btw… starting with Imperative programming (basic, assembly, classic C, classic Pascal [I miss pascal]), then eventually migrating to the Object Oriented approach (Delphi, Java, C#, C++). I didn’t much care for the OOP approach when I first encountered it (Borland made the switch and suddenly their Pascal went from imperative to OOP, and it took me quite a while to wrap my brain around it).
Since you’re starting in the Core Combat, I’ll run through this data first. I’m not going to worry about variables for timers, or variables that represent cached component references (like Mover mover = GetComponent())… those should speak for themselves as you go through the code. PlayerController.cs
struct CursorMapping //Used to map cursors for various actions
// Important bits here are the type (found in CursorTypes.cs) and the texture to use.
{
public CursorType type; //See CursorType.cs
public Texture2D texture; //Make sure texture is imported as a Cursor with Read/Write enabled
public Vector2 hotspot; //Offset from the upper left corner to the "point" of the cursor
}
[SerializeField] CursorMapping[] cursorMappings = null; //Used to match possible actions to cursor mappings.
[SerializeField] float maxNavMeshProjectionDistance = 1f; //Determines the max distance to project from the cursor when sampling the NavMesh for possible movement.
[SerializeField] float raycastRadius = 1f; //determines how large a sphere we will use when casting for potential interactions (IRayCastables).
[SerializeField] int numberOfAbilities = 6; //In ShopsAndAbilities, how many abilities our UI supports.
Nothing is saved by the Saving System in this class.
Mover.cs
[SerializeField] Transform target; //Once PlayerController takes over, this is never used again and can be safely removed.
[SerializeField] float maxSpeed = 6f; //This is multiplied by the speed fraction parameter in MoveTo to determine the speed to send to the NavMeshAgent.
[SerializeField] float maxNavPathLength = 40f; //How long of a path is considered valid for movement purposes.
This class saves and restores the player’s current position (transform.position);
Fighter.cs
This class evolves quite a bit from beginning to end
[SerializeField] float timeBetweenAttacks = 1f;
[SerializeField] Transform rightHandTransform = null; //Used to spawn weapon models
[SerializeField] Transform leftHandTransform = null;
[SerializeField] WeaponConfig defaultWeapon = null; //If no other weapon is equipped, equip this
WeaponConfig currentWeaponConfig; //the current weapon's data
LazyValue<Weapon> currentWeapon; //a link to the weapon model, used to spawn sound effects or particle systems on a Hit()
This class saves and restores the current weapon name.