Skip to content

Instantly share code, notes, and snippets.

@todorok1 todorok1/Attribute.cs
Last active Apr 12, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.