class in UnityEngine
/
Inherits from:PropertyAttribute
/
Implemented in:UnityEngine.CoreModule
Suggest a change Success!Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Close Submission failedFor some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Close Your name Your email Suggestion* DescriptionAttribute used to make a float or int variable in a script be restricted to a specific range.
When this attribute is used, the float or int will be shown as a slider in the Inspector instead of the default number field.
using UnityEngine;Constructors Constructor Description RangeAttribute Attribute used to make a float or int variable in a script be restricted to a specific range. Inherited Members Properties Property Description applyToCollection Makes attribute affect collections instead of their items. order Optional field to specify the order that multiple DecorationDrawers should be drawn in.public class Example : MonoBehaviour { // This integer will be shown as a slider, // with the range of 1 to 6 in the Inspector [Range(1, 6)] public int integerRange;
// This float will be shown as a slider, // with the range of 0.2f to 0.8f in the Inspector [Range(0.2f, 0.8f)] public float floatRange; }
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4