Example #1
0
        // ShowParameters
        protected override void ShowParameters()
        {
            base.ShowParameters();

            DrawIdentProp();

            GUILayout.Space(5f);
            TCKEditorHelper.DrawPropertyField(swipeOutProp);

            GUILayout.Space(5f);

            using (var ecc = new TCKEditorChangeCheck())
            {
                GUI.enabled = activeProp.boolValue && visibleProp.boolValue;
                TCKEditorHelper.DrawSpriteAndColor(baseImageObj, normalSpriteProp.GetLabel());
                GUI.enabled = true;

                ecc.OnChangeCheck = () =>
                {
                    normalSpriteProp.objectReferenceValue = baseImageObj.FindProperty("m_Sprite").objectReferenceValue;
                    baseImageColorProp.colorValue         = baseImageObj.FindProperty("m_Color").colorValue;
                };
            }

            TCKEditorHelper.DrawSpriteAndColor(pressedSpriteProp, pressedColorProp, pressedSpriteProp.GetLabel());
        }
Example #2
0
        // ShowParameters
        protected override void ShowParameters()
        {
            base.ShowParameters();

            DrawIdentProp();

            GUILayout.Space(5f);
            using (TCKEditorLayout.Horizontal())
            {
                GUILayout.Label(isStaticProp.GetLabel(), GUILayout.Width(TCKEditorLayout.STANDARD_SIZE));
                isStaticProp.boolValue = Convert.ToBoolean(GUILayout.Toolbar(Convert.ToInt32(isStaticProp.boolValue), modNames, EditorStyles.miniButton, GUILayout.Height(16f)));
            }

            DrawSensitivityProp();

            GUILayout.Space(5f);
            TCKEditorHelper.DrawPropertyField(borderSizeProp);

            GUILayout.Space(5f);
            using (TCKEditorLayout.Horizontal())
            {
                EditorGUILayout.PropertyField(smoothReturnProp, GUIContent.none, GUILayout.Width(15f));
                GUILayout.Label(smoothReturnProp.GetLogicLabel(), GUILayout.Width(TCKEditorLayout.STANDARD_SIZE - 20f));
                GUI.enabled = smoothReturnProp.boolValue;
                EditorGUILayout.PropertyField(smoothFactorProp, GUIContent.none);
                GUI.enabled = true;
            }

            DrawTouchZone();

            GUILayout.Space(5f);
            using (var ecc = new TCKEditorChangeCheck())
            {
                GUI.enabled = eavIsOk;
                TCKEditorHelper.DrawSpriteAndColor(joystickImageObj, "Joystick");
                TCKEditorHelper.DrawSpriteAndColor(backgroundImageObj, "Background");
                GUI.enabled = true;

                ecc.OnChangeCheck = () =>
                {
                    joystickImageColorProp.colorValue   = joystickImageObj.FindProperty("m_Color").colorValue;
                    backgroundImageColorProp.colorValue = backgroundImageObj.FindProperty("m_Color").colorValue;
                };
            }
        }