Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[HideInInspector] VS [SerializeField]
public class HideInInspectorCheck : MonoBehaviour {
// [HideInInspector]をつけてInspectorで非表示にする
[HideInInspector]
public int level;
// [HideInInspector]をつけないケース
public string characterName;
// privateに[SerializeField]をつけて表示させる
[SerializeField]
int hp;
// privateに[SerializeField]をつけない(表示されない)
int mp;
// privateに[SerializeField]と[HideInInspector]の両方をつける
[SerializeField][HideInInspector]
int atk;
// privateに[SerializeField]と[HideInInspector]の両方をつける(上とは逆の順番)
[HideInInspector][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.