Created
June 12, 2018 07:52
-
-
Save todorok1/631899a994f223576205b1b150f31b91 to your computer and use it in GitHub Desktop.
[HideInInspector] VS [SerializeField]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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