Skip to content

Instantly share code, notes, and snippets.

@todorok1
Last active April 12, 2018 08:50
Show Gist options
  • Save todorok1/5a3bcb39d34d782462f2dfcba84eff61 to your computer and use it in GitHub Desktop.
Save todorok1/5a3bcb39d34d782462f2dfcba84eff61 to your computer and use it in GitHub Desktop.
Unityチュートリアル・Inspectorの入力値制限のスクリプト。
// 複数のAttributeの書き方
// カンマ区切り
[SerializeField, Range(0f, 90f)]
float forceAngle = 45.0f;
// 逆もいける
[Range(0f, 90f), SerializeField]
float forceAngle = 45.0f;
// []で分ける
[SerializeField][Range(0f, 90f)]
float forceAngle = 45.0f;
// 改行する
[SerializeField]
[Range(0f, 90f)]
float forceAngle = 45.0f;
// もっと改行してもいいのよ?
[SerializeField]
[Range(0f, 90f)]
float forceAngle = 45.0f;
// 頭にきました
[SerializeField, Range(0f, 90f)] float forceAngle = 45.0f;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment