Hope you understood my title (question).
This is a simplified version of the code to make the concept clearer:
using UnityEngine;
using System.Collections;
public class customClasses : MonoBehaviour
{
public CharacterAttributes playerAttributes = new CharacterAttributes();
public void Start()
{
playerAttributes.level = 12; //these two changes does now show
playerAttributes.name = "Cpt. Awesome"; //but i want these changes to show
}
}
[System.Serializable] //makes the class variables show in inspector
public class CharacterAttributes
{
public string name; //shows with value "" (this is correct)
public int level; //shows with value 0 (so is this)
}
So… i have successfully made the class variables show in inspector,
BUT not the changes i perform in the top function “Start”