UnityEngine.GUILayoutEntry.ApplyOptions C# (CSharp) Method

ApplyOptions() public method

public ApplyOptions ( GUILayoutOption options ) : void
options GUILayoutOption
return void
        public virtual void ApplyOptions(GUILayoutOption[] options)
        {
            if (options != null)
            {
                foreach (GUILayoutOption option in options)
                {
                    switch (option.type)
                    {
                        case GUILayoutOption.Type.fixedWidth:
                            this.minWidth = this.maxWidth = (float) option.value;
                            this.stretchWidth = 0;
                            break;

                        case GUILayoutOption.Type.fixedHeight:
                            this.minHeight = this.maxHeight = (float) option.value;
                            this.stretchHeight = 0;
                            break;

                        case GUILayoutOption.Type.minWidth:
                            this.minWidth = (float) option.value;
                            if (this.maxWidth < this.minWidth)
                            {
                                this.maxWidth = this.minWidth;
                            }
                            break;

                        case GUILayoutOption.Type.maxWidth:
                            this.maxWidth = (float) option.value;
                            if (this.minWidth > this.maxWidth)
                            {
                                this.minWidth = this.maxWidth;
                            }
                            this.stretchWidth = 0;
                            break;

                        case GUILayoutOption.Type.minHeight:
                            this.minHeight = (float) option.value;
                            if (this.maxHeight < this.minHeight)
                            {
                                this.maxHeight = this.minHeight;
                            }
                            break;

                        case GUILayoutOption.Type.maxHeight:
                            this.maxHeight = (float) option.value;
                            if (this.minHeight > this.maxHeight)
                            {
                                this.minHeight = this.maxHeight;
                            }
                            this.stretchHeight = 0;
                            break;

                        case GUILayoutOption.Type.stretchWidth:
                            this.stretchWidth = (int) option.value;
                            break;

                        case GUILayoutOption.Type.stretchHeight:
                            this.stretchHeight = (int) option.value;
                            break;
                    }
                }
                if ((this.maxWidth != 0f) && (this.maxWidth < this.minWidth))
                {
                    this.maxWidth = this.minWidth;
                }
                if ((this.maxHeight != 0f) && (this.maxHeight < this.minHeight))
                {
                    this.maxHeight = this.minHeight;
                }
            }
        }