| 1234567891011121314151617181920212223242526272829303132333435363738 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- using System;
- namespace BansheeEngine
- {
- /** @addtogroup Serialization
- * @{
- */
- /// <summary>
- /// Makes an integer or a floating point field be displayed as a slider with a specified range in the inspector.
- /// </summary>
- [AttributeUsage(AttributeTargets.Field)]
- public sealed class Range : Attribute
- {
- /// <summary>
- /// Creates a new range attribute.
- /// </summary>
- /// <param name="min">Minimum boundary of the range to clamp the field value to.</param>
- /// <param name="max">Maximum boundary of the range to clamp the field value to.</param>
- /// <param name="slider">Whether the field should be rendered as a slider.</param>
- public Range(float min, float max, bool slider = true)
- {
- this.min = min;
- this.max = max;
- this.slider = slider;
- }
- #pragma warning disable 0414
- private float min;
- private float max;
- private bool slider;
- #pragma warning restore 0414
- }
- /** @} */
- }
|