//********************************** Banshee Engine (www.banshee3d.com) **************************************************// //**************** Copyright (c) 2016 Marko Pintera (marko.pintera@gmail.com). All rights reserved. **********************// using System; namespace BansheeEditor { /// /// Contains boolean information about a field style. /// [Flags] public enum InspectableFieldStyleFlags { None = 0, /// /// Floating point field should be represented as a slider rather than a plain input field. /// UseSlider = 1 << 0, /// /// Integer field should be represented as a layer mask drop down instead of a plain integer input field. /// UseLayerMask = 1 << 1, /// /// Object accessed by the inspectable field is passed as a copy. This means modifications to the object returned by /// the property getter will not be registered until the object is re-assigned to the property. Similarly, /// modifications to the object passed to the setter, after the setter has been called, will not be registered by /// the field. Only relevant if a field type is a reference type. /// CopiedAsValue = 1 << 2, /// /// Object returned by the inspectable field will never be null, and null should never be passed to the field. Only /// relevant if a field type is a reference type. /// NotNull = 1 << 3, /// /// Field represents a property that wraps a native object. Getters and setters of such a property issue calls into /// native code to update the native object. /// NativeWrapper = 1 << 4, /// /// When a field changes those changes need to be applied to the parent object by calling the field setter. Only /// applicable to properties containing reference types. /// ApplyOnDirty = 1 << 5, /// /// When a quaternion is displayed in the inspector, by default it will be displayed as converted into euler angles. /// Use this flag to force it to be displayed as a quaternion (4D value) with no conversion instead. /// AsQuaternion = 1 << 6, } /// /// Contains all the information about a field style. /// public class InspectableFieldStyleInfo { /// /// Information about the field range. /// public InspectableFieldRangeStyle RangeStyle; /// /// Information about the field stepping. /// public InspectableFieldStepStyle StepStyle; /// /// Boolean information about the field. /// public InspectableFieldStyleFlags StyleFlags; /// /// Creates an empty set of information about a field style. /// public InspectableFieldStyleInfo() { } /// /// Makes a deep copy of this object. /// public InspectableFieldStyleInfo Clone() { InspectableFieldStyleInfo style = new InspectableFieldStyleInfo(); style.StyleFlags = StyleFlags; if(RangeStyle != null) style.RangeStyle = new InspectableFieldRangeStyle(RangeStyle.Min, RangeStyle.Max, RangeStyle.Slider); if(StepStyle != null) style.StepStyle = new InspectableFieldStepStyle(StepStyle.Step); return style; } } }