private bool ExternalPropertiesSection()
        {
            var result = false;

            Func <GameObject, Graphic> getTitleTextFunc = go =>
            {
                var appBar = go.GetComponent <MaterialAppBar>();
                return(appBar == null ? null : appBar.titleText);
            };

            Func <GameObject, Graphic> getPanelGraphicFunc = go =>
            {
                var appBar = go.GetComponent <MaterialAppBar>();
                return(appBar == null ? null : appBar.panelGraphic);
            };

            Utils.SetBoolValueIfTrue(ref result,
                                     InspectorFields.GraphicColorMultiField("Title Text", getTitleTextFunc,
                                                                            m_TitleText.objectReferenceValue as Graphic));
            Utils.SetBoolValueIfTrue(ref result,
                                     InspectorFields.GraphicColorMultiField("Panel Graphic", getPanelGraphicFunc,
                                                                            m_PanelGraphic.objectReferenceValue as Graphic));

            return(result);
        }
Beispiel #2
0
        private bool ExternalPropertiesSection()
        {
            bool result = false;

            RectTransform barRectTransform = m_BarRectTransform.objectReferenceValue as RectTransform;

            if (barRectTransform != null)
            {
                if (InspectorFields.GraphicColorField("Bar", barRectTransform.GetComponent <Graphic>()))
                {
                    result = true;
                }
            }

            Image backgroundImage = m_BackgroundImage.objectReferenceValue as Image;

            if (backgroundImage != null)
            {
                if (InspectorFields.GraphicColorField("Background", backgroundImage))
                {
                    result = true;
                }
            }

            return(result);
        }
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            EditorGUILayout.PropertyField(m_SizeMode);
            if (m_SizeMode.enumValueIndex == 0)
            {
                EditorGUILayout.PropertyField(m_Size);
            }

            InspectorFields.GraphicColorMultiField("Icon", o => o.GetComponent <VectorImage>());

            serializedObject.ApplyModifiedProperties();
        }
Beispiel #4
0
        private bool ExternalPropertiesSection()
        {
            RectTransform circleRectTransformValue = m_CircleRectTransform.objectReferenceValue as RectTransform;

            if (circleRectTransformValue == null)
            {
                return(false);
            }
            if (circleRectTransformValue.childCount == 0)
            {
                return(false);
            }

            return(InspectorFields.GraphicColorField("Circle", circleRectTransformValue.GetChild(0).GetComponent <Graphic>()));
        }
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            EditorGUILayout.PropertyField(m_SizeMode);
            if (m_SizeMode.enumValueIndex == 0)
            {
                EditorGUILayout.PropertyField(m_Size);
            }
            EditorGUILayout.PropertyField(m_IncludeInLayoutWhenEmpty);
            EditorGUILayout.Space();

            InspectorFields.GraphicColorMultiField("Icon", gameObject => gameObject.GetComponent <VectorImageTMPro>());
            EditorGUILayout.PropertyField(m_Material);
            EditorGUILayout.PropertyField(m_RaycastTarget);
            serializedObject.ApplyModifiedProperties();
        }
        private bool OtherButtonsSection()
        {
            bool result = false;

            EditorGUI.indentLevel++;
            EditorGUILayout.PropertyField(m_Buttons, new GUIContent("References"), true);
            EditorGUI.indentLevel--;

            if (m_MaterialAppBar.buttons == null)
            {
                return(false);
            }

            for (int i = 0; i < m_MaterialAppBar.buttons.Length; i++)
            {
                Utils.SetBoolValueIfTrue(ref result, InspectorFields.MaterialButtonField(m_MaterialAppBar.buttons[i]));
            }

            return(result);
        }
        private bool ExternalPropertiesSection()
        {
            var result = false;

            var barRectTransform = m_BarRectTransform.objectReferenceValue as RectTransform;

            if (barRectTransform != null)
            {
                Utils.SetBoolValueIfTrue(ref result,
                                         InspectorFields.GraphicColorField("Bar", barRectTransform.GetComponent <Graphic>()));
            }

            var backgroundImage = m_BackgroundImage.objectReferenceValue as Image;

            if (backgroundImage != null)
            {
                Utils.SetBoolValueIfTrue(ref result, InspectorFields.GraphicColorField("Background", backgroundImage));
            }

            return(result);
        }
 private bool ExternalPropertiesSection()
 {
     return(InspectorFields.MaterialButtonMultiField(go => go.GetComponent <MaterialButton>(), m_SelectedMaterialButton));
 }
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            EditorGUI.BeginChangeCheck();
            {
                LayoutStyle_PropertyField(m_Interactable);
            }
            if (EditorGUI.EndChangeCheck())
            {
                m_Toggle.interactable = m_Interactable.boolValue;
            }

            EditorGUILayout.Space();
            LayoutStyle_PropertyField(m_AnimationDuration);
            EditorGUILayout.Space();

            LayoutStyle_PropertyField(m_AutoRegisterInParentGroup);
            LayoutStyle_PropertyField(m_Group);
            EditorGUILayout.Space();
            if (m_Graphic.objectReferenceValue != null)
            {
                LayoutStyle_PropertyField(m_GraphicChangesWithToggleState);

                if (m_GraphicChangesWithToggleState.boolValue)
                {
                    if (m_Graphic.objectReferenceValue is Image || m_Graphic.objectReferenceValue is IVectorImage)
                    {
                        LayoutStyle_PropertyField(m_ToggleOnIcon);
                        LayoutStyle_PropertyField(m_ToggleOffIcon);
                    }
                    else
                    {
                        LayoutStyle_PropertyField(m_ToggleOnLabel);
                        LayoutStyle_PropertyField(m_ToggleOffLabel);
                    }
                }
                else
                {
                    var v_target = target as ToggleBase;
                    InspectorFields.GraphicMultiField("Graphic Value", new Graphic[] { v_target.graphic });
                }
            }

            EditorGUILayout.Space();
            InheritedFieldsSection();
            EditorGUILayout.Space();

            EditorGUI.BeginDisabledGroup(m_IsControllingChildren);
            {
                EditorGUI.BeginChangeCheck();
                {
                    DrawFoldoutColors(ColorsSection);
                }
                if (EditorGUI.EndChangeCheck())
                {
                    m_Toggle.EditorValidate();
                }
            }
            EditorGUI.EndDisabledGroup();

            EditorGUI.BeginChangeCheck();
            {
                DrawFoldoutComponents(ComponentsSection);
            }

            if (EditorGUI.EndChangeCheck())
            {
                m_Toggle.EditorValidate();
            }

            EditorGUILayout.Space();
            EditorGUILayout.PropertyField(m_OnToggleOn);
            EditorGUILayout.PropertyField(m_OnToggleOff);

            DrawStyleGUIFolder();

            serializedObject.ApplyModifiedProperties();
        }