Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SerializeFieldとNonSerializedの頂上バトル
// privateに[SerializeField]をつけて表示させる
[SerializeField]
int hp;
// privateに[SerializeField]をつけない(表示されない)
int mp;
// privateに[SerializeField]と[System.NonSerialized]の両方をつける
[SerializeField][System.NonSerialized]
int atk;
// privateに[SerializeField]と[System.NonSerialized]の両方をつける(上とは逆の順番)
[System.NonSerialized][SerializeField]
int def;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.