Range Attribute Unity Code Example


Example: how to set a range for public int or float unity

using UnityEngine;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; }

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable