Ejemplo n.º 1
0
        /// <summary>
        /// Draws the property.
        /// </summary>
        protected override void DrawPropertyLayout(InspectorProperty property, ShowIfAttribute attribute, GUIContent label)
        {
            bool   result;
            string errorMessage;

            IfAttributesHelper.HandleIfAttributesCondition(this, property, attribute.MemberName, attribute.Value, out result, out errorMessage);

            if (errorMessage != null)
            {
                AllEditorGUI.ErrorMessageBox(errorMessage);
                this.CallNextDrawer(property, label);
            }
            else
            {
                if (attribute.Animate)
                {
                    if (AllEditorGUI.BeginFadeGroup(UniqueDrawerKey.Create(property, this), result))
                    {
                        this.CallNextDrawer(property, label);
                    }
                    AllEditorGUI.EndFadeGroup();
                }
                else
                {
                    if (result)
                    {
                        this.CallNextDrawer(property, label);
                    }
                }
            }
        }
        /// <summary>
        /// Draws the property.
        /// </summary>
        protected override void DrawPropertyLayout(InspectorProperty property, EnableIfAttribute attribute, GUIContent label)
        {
            if (GUI.enabled == false)
            {
                this.CallNextDrawer(property, label);
                return;
            }

            bool   result;
            string errorMessage;

            IfAttributesHelper.HandleIfAttributesCondition(this, property, attribute.MemberName, attribute.Value, out result, out errorMessage);

            if (errorMessage != null)
            {
                SirenixEditorGUI.ErrorMessageBox(errorMessage);
                this.CallNextDrawer(property, label);
            }
            else if (!result)
            {
                GUIHelper.PushGUIEnabled(false);
                this.CallNextDrawer(property, label);
                GUIHelper.PopGUIEnabled();
            }
            else
            {
                this.CallNextDrawer(property, label);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Draws the property.
        /// </summary>
        protected override void DrawPropertyLayout(GUIContent label)
        {
            bool   result;
            string errorMessage;

            var property  = this.Property;
            var attribute = this.Attribute;

            IfAttributesHelper.HandleIfAttributesCondition(this, property, attribute.MemberName, attribute.Value, out result, out errorMessage);

            if (errorMessage != null)
            {
                SirenixEditorGUI.ErrorMessageBox(errorMessage);
                this.CallNextDrawer(label);
            }
            else
            {
                if (attribute.Animate)
                {
                    if (SirenixEditorGUI.BeginFadeGroup(UniqueDrawerKey.Create(property, this), result))
                    {
                        this.CallNextDrawer(label);
                    }
                    SirenixEditorGUI.EndFadeGroup();
                }
                else
                {
                    if (result)
                    {
                        this.CallNextDrawer(label);
                    }
                }
            }
        }