Make inspector show changes of class variable value in function?

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 = "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”

Remove “= new CharacterAttributes();” from the declaration. It’s useless since it’S a serialized variable and class so the Unity inspector will create the instance automatically. System.Serializable classes actually act more like structs :wink:

Anyway you should see the changes in the inspector when you press play. Or when do you expect the changes?

I’ve just tried your class and i see the changes when i press play. I’m not sure what behaviour you would expect…