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.