Store Player Stats

Store Player Stats

My character creation order is: Select Race, Select Class, Assign Bonus Stat Points, Customize and Name the character.
Because I am using Unity's UI components I am using scripts attached to empty objects (eg. _RaceManager, _ClassManager) that handle which button is pressed and select the actual race or class.
However a look on the inspector shows stat values as 0. So I must be doing something wrong!
MY QUESTION: How would my Playing Character (Player) get the selected values depending on race and class?
Here is an example of my code (actual code is too big to post): 
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.EventSystems;

public class Class_GOnClick : MonoBehaviour {
    public GameObject Barbarian, Knight, Paladin, Assassin, Scout, Shadow, Elementalist, Druid, Summoner, Priest, Hunter, Next, Previous, descRect, ClassPanel, RacePanel, RaceManager;
    StageIDs sID = new StageIDs(); //0 - ERROR, 1 - RACE, 2 - CLASS, 3 - STATS, 4 - CUSTOMIZATION
    public static BaseClass classSelection;
    public void Start()
    {
        sID.id = 2;
        Barbarian.GetComponent

Solutions/Answers:

Answer 1:

Move _info into class-scope. In your code it is a local variable which is destroyed when isBarbarian returns

public SaveInformation _Info; 
public void Start()
...
public void isBarbarian()
{
   _Info = new SaveInformation();
   ...
}

When you make changes to your .NET assemblies, Unity copies the existing data to the un-managed side, reloads the new assemblies, then copies the data back. Classes you create are not serializable, by default, so Unity will not be able to “see” them. This is also required since this SaveInformation is probably going to be…. saved (serialized to disk). This is done through the [System.Serializable] class-level attribute and the [NonSerialized]/[SerializeField] field-level attributes.

[System.Serializable] //This allows Unity to "see"
class SaveInformation
{
   public float PublicFloat1; //Serialized

   [NonSerialized]
   public float PublicFloat2; //Not serialized

   private float PrivateFloat1; //Not serialized

   [SerializeField]
   private float PrivateFloat2; //Serialized
   ...
}

References