Exemplo n.º 1
0
        /// <summary> Creates a new instance of the drawer or returns a reusable instance from the pool. </summary>
        /// <param name="value"> The initial cached value of the drawer. </param>
        /// <param name="memberInfo"> LinkedMemberInfo for the class member that the created drawer represents. Can be null. </param>
        /// <param name="parent"> The parent drawer of the created drawer. Can be null. </param>
        /// <param name="label"> The prefix label. </param>
        /// <param name="setReadOnly"> True if drawer should be read only. </param>
        /// <returns> The drawer instance, ready to be used. </returns>
        public static Size2DDrawer Create(Size2D value, LinkedMemberInfo memberInfo, IParentDrawer parent, GUIContent label, bool setReadOnly)
        {
            Size2DDrawer result;

            if (!DrawerPool.TryGet(out result))
            {
                result = new Size2DDrawer();
            }
            result.Setup(value, typeof(Size2D), memberInfo, parent, label, setReadOnly);
            result.LateSetup();
            return(result);
        }
Exemplo n.º 2
0
        /// <inheritdoc />
        protected override IDrawer BuildResizeField()
        {
            var resizerMemberInfo = ResizerMemberInfo;

            return(Size2DDrawer.Create(size.IsValid() ? size : Size2D.Zero, resizerMemberInfo, this, GUIContentPool.Create("Sizes"), ReadOnly || resizerMemberInfo == null));
        }