private void FieldLiveBounds()
    {
        int texWidth  = sprite.currentTextureWidth;
        int texHeight = sprite.currentTextureHeight;

        MadGUI.PropertyField(hasLiveBounds, "Has Border");

        GUI.backgroundColor = Color.yellow;
        MadGUI.Indent(() => {
            MadGUI.LookLikeControls(0, 40);
            FieldLiveBounds(liveLeft, texWidth, "Left", 0, liveRight.floatValue);
            FieldLiveBounds(liveTop, texHeight, "Top", liveBottom.floatValue, 1);
            FieldLiveBounds(liveRight, texWidth, "Right", liveLeft.floatValue, 1);
            FieldLiveBounds(liveBottom, texHeight, "Bottom", 0, liveTop.floatValue);
            MadGUI.LookLikeControls(0);
        });
        GUI.backgroundColor = Color.white;

        EditorGUILayout.Space();

        EditorGUILayout.BeginHorizontal();
        if (MadGUI.Button("Reset"))
        {
            ResetLiveBounds();
        }
        if (MadGUI.Button("Compute"))
        {
            MadUndo.RecordObject2(sprite, "Set Live Bounds");
            ComputeLiveBounds();
        }
        EditorGUILayout.EndHorizontal();
    }
    protected void ConfigurationField()
    {
        MadGUI.PropertyField(useCurrentlyActiveConfiguration, "Use Currently Active");

        if (!s.useCurrentlyActiveConfiguration)
        {
            MadGUI.PropertyField(configuration, "Configuration", MadGUI.ObjectIsSet);
        }
        else
        {
            using (MadGUI.EnabledIf(false)) {
                EditorGUILayout.ObjectField("Configuration", s.currentConfiguration, typeof(MadLevelConfiguration),
                                            false);
            }

            if (!s.CurrentConfigurationValid())
            {
                bool help = MadGUI.ErrorFix("Current configuration does not include current level select screen or it cannot find current group. " +
                                            "Please make sure to use a similar copy to the original configuration.", "Help");
                if (help)
                {
                    Application.OpenURL(MadLevelHelp.ActiveConfiguration);
                }
            }
        }
    }
예제 #3
0
    protected void IconTemplateField()
    {
        MadGUI.PropertyField(iconTemplateQuantity, "Icon Quantity");

        using (MadGUI.Indent()) {
            if (s.iconTemplateQuantity == MadLevelAbstractLayout.IconTemplateQuantity.Single)
            {
                MadGUI.PropertyField(iconTemplate, "Icon Template", MadGUI.ObjectIsSet);
                if (s.iconTemplate != null)
                {
                    var prefabType = PrefabUtility.GetPrefabType(s.iconTemplate);
                    if (prefabType == PrefabType.None)
                    {
                        MadGUI.Warning(
                            "It's recommended to use prefab as a template. All visible icon instances will be linked to this prefab.");
                    }
                }
            }
            else
            {
                int i    = 1;
                var list = new MadGUI.ArrayList <MadLevelIcon>(iconTemplates, (icon) => {
                    MadGUI.PropertyField(icon, "Template " + (i++));
                });
                list.drawAddButton    = false;
                list.drawOrderButtons = false;
                list.drawRemoveButton = false;
                list.Draw();
            }
        }
    }
예제 #4
0
    void GUICreator(bool recreate)
    {
        serializedObject.Update();
        MadGUI.PropertyField(inputType, "Input Type");

        bool canCreate = false;

        switch ((MadFont.InputType)inputType.enumValueIndex)
        {
        case MadFont.InputType.TextureAndGlyphList:
            canCreate = GUITextureAndGlyphListCreator();
            break;

        case MadFont.InputType.Bitmap:
            canCreate = GUIBitmapFontCreator();
            break;
        }

        MadGUI.PropertyField(forceWhite, "Force White Color", "Forces this font to be rendered with white color only.");

        serializedObject.ApplyModifiedProperties();

        GUI.enabled = canCreate;
        if (GUILayout.Button(recreate ? "Recreate" : "Create"))
        {
            var builder = new MadFontBuilder(target as MadFont);
            builder.white = forceWhite.boolValue;
            builder.Build();
        }
        GUI.enabled = true;
    }
예제 #5
0
    public override void OnInspectorGUI()
    {
        serializedObject.UpdateIfDirtyOrScript();

        GUI.color = Color.yellow;
        if (GUILayout.Button("<< Back To Layer Listing"))
        {
            Selection.activeGameObject = layer.parent.gameObject;
        }
        GUI.color = Color.white;
        GUILayout.Space(16);

        MadGUI.PropertyField(texture, "Texture");
        MadGUI.PropertyField(tint, "Tint");

        EditorGUILayout.Space();

        MadGUI.PropertyField(scaleMode, "Scale Mode");

        MadGUI.PropertyField(repeatX, "Repeat X");
        MadGUI.PropertyField(repeatY, "Repeat Y");

        MadGUI.ConditionallyEnabled(layer.scaleMode == MadLevelBackgroundLayer.ScaleMode.Fill && !layer.repeatX && !layer.repeatY, () => {
            if (MadGUI.Foldout("Margin", false))
            {
                MadGUI.Indent(() => {
                    MadGUI.PropertyField(fillMarginLeft, "Left");
                    MadGUI.PropertyField(fillMarginTop, "Top");
                    MadGUI.PropertyField(fillMarginRight, "Right");
                    MadGUI.PropertyField(fillMarginBottom, "Bottom");
                });
            }
        });

        MadGUI.ConditionallyEnabled(!layer.repeatX && !layer.repeatY, () => {
            MadGUI.PropertyField(dontStretch, "Don't Stretch");
        });

        if (scaleMode.enumValueIndex == (int)MadLevelBackgroundLayer.ScaleMode.Manual)
        {
            MadGUI.PropertyField(align, "Align");
            EditorGUILayout.Space();
            MadGUI.PropertyFieldVector2Compact(position, "Position", 70);
            MadGUI.PropertyFieldVector2Compact(scale, "Scale", 70);
        }
        else
        {
            MadGUI.PropertyFieldVector2Compact(position, "Position", 70);
        }

        EditorGUILayout.Space();

        MadGUI.PropertyField(followSpeed, "Follow Speed");
        MadGUI.PropertyFieldVector2Compact(scrollSpeed, "Auto Scroll", 70);

        if (serializedObject.ApplyModifiedProperties())
        {
            layer.SetDirty();
        }
    }
예제 #6
0
    // ===========================================================
    // Static Methods
    // ===========================================================

    public static void DrawInspector(SerializedObject so)
    {
        so.Update();

        var mode         = so.FindProperty("mode");
        var position     = so.FindProperty("position");
        var anchorObject = so.FindProperty("anchorObject");
        var anchorCamera = so.FindProperty("anchorCamera");
        var moveIn3D     = so.FindProperty("moveIn3D");
        var faceCamera   = so.FindProperty("faceCamera");

        MadGUI.PropertyField(mode, "Mode");
        switch ((MadAnchor.Mode)mode.enumValueIndex)
        {
        case MadAnchor.Mode.ObjectAnchor:
            MadGUI.PropertyField(anchorObject, "Anchor Object");
            MadGUI.PropertyField(anchorCamera, "Anchor Camera");
            MadGUI.PropertyField(moveIn3D, "Move In 3D");
            MadGUI.PropertyField(faceCamera, "Face Camera", "Bar graphics will always face anchor camera.");
            break;

        case MadAnchor.Mode.ScreenAnchor:
            MadGUI.PropertyField(position, "Position");
            break;

        default:
            MadDebug.Assert(false, "Unknown mode: " + (MadAnchor.Mode)mode.enumValueIndex);
            break;
        }

        so.ApplyModifiedProperties();
    }
예제 #7
0
 public override void OnInspectorGUI() {
     serializedObject.UpdateIfDirtyOrScript();
 
     MadGUI.PropertyField(dragArea, "Drag Area");
     MadGUI.PropertyFieldVector2(dragStartPosition, "Drag Start Position");
     
     MadGUI.PropertyField(scaling, "Allow Scaling");
     MadGUI.ConditionallyEnabled(scaling.boolValue, () => {
         MadGUI.Indent(() => {
             MadGUI.PropertyField(scalingMin, "Scaling Min");
             MadGUI.PropertyField(scalingMax, "Scaling Max");
         });
     });
     
     MadGUI.PropertyField(moveEasing, "Move Easing");
     MadGUI.ConditionallyEnabled(moveEasing.boolValue, () => {
         MadGUI.Indent(() => {
             MadGUI.PropertyField(moveEasingType, "Type");
             MadGUI.PropertyField(moveEasingDuration, "Duration");
         });
     });
     
     MadGUI.PropertyField(scaleEasing, "Scale Easing");
     MadGUI.ConditionallyEnabled(scaleEasing.boolValue, () => {
         MadGUI.Indent(() => {
             MadGUI.PropertyField(scaleEasingType, "Type");
             MadGUI.PropertyField(scaleEasingDuration, "Duration");
         });
     });
     
     serializedObject.ApplyModifiedProperties();
 }
    protected void LookAtLastLevel()
    {
        MadGUI.PropertyField(lookAtLastLevel, "Look At Previous Level", "When scene is loaded, it will automatically "
                             + "go to the previously played level (but only if previous scene is of type Level.");

        GUILayout.Label("If above is disabled or cannot be determined, then...");

        MadGUI.PropertyFieldEnumPopup(lookAtLevel, "Look At Level");
    }
예제 #9
0
    void GUICreator(bool created)
    {
        serializedObject.Update();
        MadGUI.PropertyField(inputType, "Input Type");

        bool canCreate = false;

        switch ((MadFont.InputType)inputType.enumValueIndex)
        {
        case MadFont.InputType.TextureAndGlyphList:
            canCreate = GUITextureAndGlyphListCreator();
            break;

        case MadFont.InputType.Bitmap:
            canCreate = GUIBitmapFontCreator();
            break;
        }

        EditorGUI.BeginChangeCheck();
        MadGUI.PropertyField(forceWhite, "Force White Color", "Forces this font to be rendered with white color only.");
        if (EditorGUI.EndChangeCheck())
        {
            if (script.created)
            {
                ReloadColors();
            }
        }

        MadGUI.ConditionallyEnabled(!forceWhite.boolValue, () => {
            EditorGUI.BeginChangeCheck();
            primaryColor   = EditorGUILayout.ColorField("Primary Color", primaryColor);
            secondaryColor = EditorGUILayout.ColorField("Secondary Color", secondaryColor);
            if (EditorGUI.EndChangeCheck())
            {
                if (created)
                {
                    SetColors();
                }
            }
        });

        serializedObject.ApplyModifiedProperties();

        GUI.enabled = canCreate;
        if (GUILayout.Button(created ? "Recreate" : "Create"))
        {
            var builder = new MadFontBuilder(script);
            builder.white = forceWhite.boolValue;
            builder.Build();

            if (!forceWhite.boolValue && script.created)
            {
                SetColors();
            }
        }
        GUI.enabled = true;
    }
    public override void OnInspectorGUI()
    {
        serializedObject.UpdateIfDirtyOrScript();

        MadGUI.PropertyField(moveEasingType, "Type");
        MadGUI.PropertyField(moveEasingDuration, "Duration");

        serializedObject.ApplyModifiedProperties();
    }
예제 #11
0
    public override void OnInspectorGUI()
    {
        serializedObject.UpdateIfDirtyOrScript();

        MadGUI.PropertyField(animationName, "Animation TypeID");
        EditorGUILayout.Space();

        DrawInspector();
        EditorGUILayout.Space();

        MadGUI.PropertyField(duration, "Duration");
        MadGUI.PropertyField(delay, "Delay");
        MadGUI.PropertyFieldSlider(offset, 0, 1, "Offset");
        EditorGUILayout.Space();

        MadGUI.PropertyField(useAnimationCurve, "Use Animation Curve");
        using (MadGUI.Indent()) {
            if (!useAnimationCurve.boolValue)
            {
                MadGUI.PropertyFieldEnumPopup(easing, "Easing");
            }
            else
            {
                MadGUI.PropertyField(animationCurve, "Curve");
            }
        }
        MadGUI.PropertyFieldEnumPopup(wrapMode, "Wrap Mode");
        MadGUI.PropertyField(queue, "Queue");
        EditorGUILayout.Space();

        MadGUI.PropertyField(playOnAwake, "Play On Awake");
        MadGUI.PropertyField(destroyObjectOnFinish, "Destroy On Finish");
        MadGUI.PropertyField(sendMessageOnFinish, "Send Message On Finish");

        if (sendMessageOnFinish.boolValue)
        {
            using (MadGUI.Indent()) {
                MadGUI.PropertyField(messageReceiver, "Receiver", MadGUI.ObjectIsSet);
                MadGUI.PropertyField(messageName, "Method TypeID", MadGUI.StringNotEmpty);
            }
        }

        MadGUI.PropertyField(playAnimationOnFinish, "Play Animation On Finish");

        if (playAnimationOnFinish.boolValue)
        {
            using (MadGUI.Indent()) {
                MadGUI.PropertyField(playAnimationOnFinishName, "TypeID", MadGUI.StringNotEmpty);
                MadGUI.PropertyField(playAnimationOnFinishFromTheBeginning, "From The Beginning");
            }
        }

        MadGUI.PropertyField(ignoreTimeScale, "Ignore Time Scale");

        serializedObject.ApplyModifiedProperties();
    }
예제 #12
0
    private void PropertyFieldAnimationName(SerializedProperty animationName, string label)
    {
        //string nameBefore = animationName.stringValue;
        MadGUI.PropertyField(animationName, "Animation TypeID");
        //string nameAfter = animationName.stringValue;

        //if (nameBefore != nameAfter) {
        //    UpdateAnimationName(nameBefore, nameAfter);
        //}
    }
예제 #13
0
 private void GUIStartupProperty(SerializedProperty method, SerializedProperty value, string label)
 {
     MadGUI.PropertyFieldEnumPopup(method, label);
     if (method.enumValueIndex != (int)MadLevelAnimator.ApplyMethod.DoNotChange)
     {
         using (MadGUI.Indent()) {
             MadGUI.PropertyField(value, "");
             EditorGUILayout.Space();
         }
     }
 }
    void ActivateAction(
        SerializedProperty playAudio,
        SerializedProperty playAudioClip,
        SerializedProperty playAudioVolume,
        SerializedProperty message,
        SerializedProperty messageReceiver,
        SerializedProperty messageMethodName,
        SerializedProperty messageIncludeChildren
        )
    {
        MadGUI.PropertyField(playAudio, "Play Audio");
        MadGUI.ConditionallyEnabled(playAudio.boolValue, () => {
            MadGUI.Indent(() => {
                if (playAudio.boolValue && !FoundAudioListener())
                {
                    if (MadGUI.ErrorFix("There's no AudioListener on the scene. Do you want me to add an "
                                        + "AudioListener to Camera 2D?", "Add"))
                    {
                        var camera = MadTransform.FindParent <Camera>((target as Component).transform);
                        if (camera == null)
                        {
                            camera = FindObjectOfType(typeof(Camera)) as Camera;
                        }
                        if (camera != null)
                        {
                            camera.gameObject.AddComponent <AudioListener>();
                        }
                        else
                        {
                            Debug.LogError("There's no camera on this scene!");
                        }
                    }
                }

                MadGUI.PropertyField(playAudioClip, "Audio Clip", MadGUI.ObjectIsSet);
                MadGUI.PropertyFieldSlider(playAudioVolume, 0, 1, "Volume");
            });
        });

        MadGUI.PropertyField(message, "Send Message");
        MadGUI.ConditionallyEnabled(message.boolValue, () => {
            MadGUI.Indent(() => {
                MadGUI.PropertyField(messageReceiver, "Receiver", MadGUI.ObjectIsSet);
                MadGUI.PropertyField(messageMethodName, "Method Name", MadGUI.StringNotEmpty);
                MadGUI.PropertyField(messageIncludeChildren, "Include Children");

                if (message.boolValue)
                {
                    MadGUI.Info("This should look like this:\nvoid " + messageMethodName.stringValue + "(MadLevelIcon icon)");
                }
            });
        });
    }
    private void GUIGameObjectList(string header, SerializedProperty array)
    {
        GUILayout.Label(header, "HeaderLabel");

        using (MadGUI.Indent()) {
            var arraylist = new MadGUI.ArrayList <GameObject>(array, property => {
                MadGUI.PropertyField(property, "");
            });
            arraylist.drawOrderButtons = false;
            arraylist.Draw();
        }
    }
예제 #16
0
    public override void OnInspectorGUI()
    {
        SectionSprite(DisplayFlag.WithoutSize | DisplayFlag.WithoutMaterial | DisplayFlag.WithoutFill);

        serializedObject.Update();
        MadGUI.PropertyField(font, "Font");
        EditorGUILayout.LabelField("Text");
        text.stringValue = EditorGUILayout.TextArea(text.stringValue);
        MadGUI.PropertyField(scale, "Scale");
        MadGUI.PropertyField(letterSpacing, "Letter Spacing");

        serializedObject.ApplyModifiedProperties();
    }
예제 #17
0
    bool GUIBitmapFontCreator()
    {
        MadGUI.Info(
            "The bitmap font creation mostly takes place outside Unity. "
            + "For this purpose you can use BMFont on Windows, Glyph Designer, or bmGlyph on Mac.\n\n"
            + "These tools will create a texture and FNT file that you should drag into the field below. "
            + "Please note that you should change FNT file extension to TXT.");

        MadGUI.PropertyField(texture, "Font Texture");
        MadGUI.PropertyField(fntFile, "FNT File");

        return(script.texture != null && script.fntFile != null);
    }
    private void FieldMessage(SerializedProperty sp)
    {
        var receiver   = sp.FindPropertyRelative("receiver");
        var methodName = sp.FindPropertyRelative("methodName");

        MadGUI.PropertyField(receiver, "");
        if (receiver.objectReferenceValue != null)
        {
            using (MadGUI.Indent()) {
                MadGUI.PropertyField(methodName, "Method Name");
            }
        }
    }
예제 #19
0
    public override void OnInspectorGUI()
    {
        SectionSprite(DisplayFlag.WithoutSize | DisplayFlag.WithoutMaterial | DisplayFlag.WithoutFill);

        serializedObject.Update();
        MadGUI.PropertyField(panel, "Panel", MadGUI.ObjectIsSet);
        EditorGUILayout.Space();

        EditorGUI.BeginChangeCheck();
        MadGUI.PropertyField(font, "Font", MadGUI.ObjectIsSet);
        if (EditorGUI.EndChangeCheck())
        {
            UpdateTextureGUID();
        }

        MadGUI.PropertyField(atlas, "Atlas");

        if (madText.atlas != null && madText.font != null)
        {
            var texture     = madText.font.texture;
            var texturePath = AssetDatabase.GetAssetPath(texture);
            var textureGuid = AssetDatabase.AssetPathToGUID(texturePath);
            if (madText.atlas.GetItem(textureGuid) == null)
            {
                if (MadGUI.WarningFix("This font texture is not available in selected atlas.", "Add to atlas"))
                {
                    MadAtlasBuilder.AddToAtlas(madText.atlas, madText.font.texture);
                }
            }
        }

        EditorGUILayout.LabelField("Text");
        if (text.hasMultipleDifferentValues)
        {
            EditorGUILayout.TextArea("-");
        }
        else
        {
            text.stringValue = EditorGUILayout.TextArea(text.stringValue);
        }
        MadGUI.PropertyField(scale, "Scale");
        MadGUI.PropertyField(align, "Align");
        MadGUI.PropertyField(letterSpacing, "Letter Spacing");
        MadGUI.PropertyField(wordWrap, "Word Wrap");
        MadGUI.Indent(() => {
            MadGUI.PropertyField(wordWrapLength, "Line Length");
        });

        serializedObject.ApplyModifiedProperties();
    }
    protected void HandleMobileBack()
    {
        MadGUI.PropertyField(handleMobileBackButton, "Handle Mobile 'Back'",
                             "Handles mobile 'back' action by loading selected level.");
        MadGUI.Indent(() => {
            MadGUI.PropertyFieldEnumPopup(handleMobileBackButtonAction, "Action");

            if (s.handleMobileBackButtonAction == MadLevelAbstractLayout.OnMobileBack.LoadSpecifiedLevel)
            {
                MadGUI.Indent(() => {
                    MadGUI.PropertyField(handleMobileBackButtonLevelName, "Level Name", MadGUI.StringNotEmpty);
                });
            }
        });
    }
예제 #21
0
    protected void GUIAnimationRef(SerializedProperty animationRef, bool showFromTheBeginning)
    {
        var name = animationRef.FindPropertyRelative("name");

        GUIAnimationName(name);
        //MadGUI.PropertyField(name, "Name");

        if (showFromTheBeginning)
        {
            using (MadGUI.Indent()) {
                var fromTheBeginning = animationRef.FindPropertyRelative("fromTheBeginning");
                MadGUI.PropertyField(fromTheBeginning, "From The Start");
            }
        }
    }
예제 #22
0
    public override void OnInspectorGUI()
    {
        serializedObject.UpdateIfDirtyOrScript();

        MadGUI.PropertyField(dragBounds, "Drag Area");

        EditorGUILayout.Space();

        MadGUI.ConditionallyEnabled(HasBackground(), () => {
            if (MadGUI.Button("Resize Drag Area To Background", Color.yellow))
            {
                ResizeDragAreaToBackground();
            }
        });

        EditorGUILayout.Space();

        MadGUI.PropertyFieldEnumPopup(scaleMode, "Allow Scaling");
        MadGUI.ConditionallyEnabled(script.scaleMode == MadFreeDraggable.ScaleMode.Free, () => {
            MadGUI.Indent(() => {
                MadGUI.PropertyField(scalingMin, "Scaling Min");
                MadGUI.PropertyField(scalingMax, "Scaling Max");
            });
        });

        EditorGUILayout.Space();

        MadGUI.PropertyField(moveEasing, "Move Easing");
        MadGUI.ConditionallyEnabled(moveEasing.boolValue, () => {
            MadGUI.Indent(() => {
                MadGUI.PropertyField(moveEasingType, "Type");
                MadGUI.PropertyField(moveEasingDuration, "Duration");
            });
        });

        EditorGUILayout.Space();

        MadGUI.PropertyField(scaleEasing, "Scale Easing");
        MadGUI.ConditionallyEnabled(scaleEasing.boolValue, () => {
            MadGUI.Indent(() => {
                MadGUI.PropertyField(scaleEasingType, "Type");
                MadGUI.PropertyField(scaleEasingDuration, "Duration");
            });
        });

        serializedObject.ApplyModifiedProperties();
    }
예제 #23
0
    protected void SectionSprite(DisplayFlag flags)
    {
        serializedObject.Update();
        MadGUI.PropertyField(visible, "Visible");

        if ((flags & DisplayFlag.WithoutMaterial) == 0)
        {
            MadGUI.PropertyField(texture, "Texture", MadGUI.ObjectIsSet);
            MadGUI.Indent(() => {
                MadGUI.PropertyFieldVector2(textureRepeat, "Repeat");
                MadGUI.PropertyFieldVector2(textureOffset, "Offset");
            });
        }

        MadGUI.PropertyField(tint, "Tint");

        if ((flags & DisplayFlag.WithoutSize) == 0)
        {
            if (GUILayout.Button(new GUIContent("Resize To Texture",
                                                "Resizes this sprite to match texture size")))
            {
                var sprite = target as MadSprite;
                MadUndo.RecordObject2(sprite, "Resize To Texture");
                sprite.ResizeToTexture();
                EditorUtility.SetDirty(sprite);
            }
        }

        MadGUI.PropertyField(pivotPoint, "Pivot Point");
        MadGUI.PropertyField(guiDepth, "GUI Depth");

        if ((flags & DisplayFlag.WithoutFill) == 0)
        {
            MadGUI.PropertyField(fillType, "Fill Type");
            EditorGUILayout.Slider(fillValue, 0, 1, "Fill Value");

            if (sprite.fillType == MadSprite.FillType.RadialCCW || sprite.fillType == MadSprite.FillType.RadialCW)
            {
                MadGUI.PropertyFieldSlider(radialFillOffset, -1, 1, "Offset");
                MadGUI.PropertyFieldSlider(radialFillLength, 0, 1, "Length");
            }
        }

        serializedObject.ApplyModifiedProperties();
    }
    public override void OnInspectorGUI()
    {
        serializedObject.UpdateIfDirtyOrScript();

        MadGUI.PropertyField(moveEasingType, "Type");
        MadGUI.PropertyField(moveEasingDuration, "Duration");

        EditorGUILayout.Space();

        GUILayout.Label("Swipe", "HeaderLabel");
        using (MadGUI.Indent()) {
            MadGUI.PropertyField(swipeVirtualDistanceModifier, "Virtual Distance Modifier");
            MadGUI.PropertyField(limitSwipeToSinglePage, "Limit To A Single Page");
            MadGUI.PropertyField(switchAfterDistance, "Switch Page After Distance");
        }

        serializedObject.ApplyModifiedProperties();
    }
예제 #25
0
    protected override void DrawInspector()
    {
        MadGUI.PropertyFieldEnumPopup(rotateFrom, "From");

        if (rotateFrom.enumValueIndex >= 2)
        {
            using (MadGUI.Indent()) {
                MadGUI.PropertyField(rotateFromValue, "Value");
            }
        }

        MadGUI.PropertyFieldEnumPopup(rotateTo, "To");

        if (rotateTo.enumValueIndex >= 2)
        {
            using (MadGUI.Indent()) {
                MadGUI.PropertyField(rotateToValue, "Value");
            }
        }
    }
    protected override void DrawInspector()
    {
        MadGUI.PropertyFieldEnumPopup(colorFrom, "From");

        if (colorFrom.enumValueIndex == (int)MadAnimColor.ValueType.Value)
        {
            using (MadGUI.Indent()) {
                MadGUI.PropertyField(colorFromValue, "Value");
            }
        }

        MadGUI.PropertyFieldEnumPopup(colorTo, "To");

        if (colorTo.enumValueIndex == (int)MadAnimColor.ValueType.Value)
        {
            using (MadGUI.Indent()) {
                MadGUI.PropertyField(colorToValue, "Value");
            }
        }
    }
예제 #27
0
    protected override void DrawInspector()
    {
        MadGUI.PropertyFieldEnumPopup(moveFrom, "From");

        if (moveFrom.enumValueIndex >= 2)
        {
            using (MadGUI.Indent()) {
                MadGUI.PropertyField(moveFromPosition, "Position");
            }
        }

        MadGUI.PropertyFieldEnumPopup(moveTo, "To");

        if (moveTo.enumValueIndex >= 2)
        {
            using (MadGUI.Indent()) {
                MadGUI.PropertyField(moveToPosition, "Position");
            }
        }
    }
예제 #28
0
    public override void OnInspectorGUI()
    {
        serializedObject.UpdateIfDirtyOrScript();

        GUI.color = Color.yellow;
        if (GUILayout.Button("<< Back To Layer Listing"))
        {
            Selection.activeGameObject = layer.parent.gameObject;
        }
        GUI.color = Color.white;
        GUILayout.Space(16);

        MadGUI.PropertyField(texture, "Texture");
        MadGUI.PropertyField(tint, "Tint");

        EditorGUILayout.Space();

        MadGUI.PropertyField(scaleMode, "Scale Mode");

        if (scaleMode.enumValueIndex == (int)MadLevelBackgroundLayer.ScaleMode.Manual)
        {
            MadGUI.PropertyField(align, "Align");
            EditorGUILayout.Space();
            MadGUI.PropertyFieldVector2Compact(position, "Position", 70);
            MadGUI.PropertyFieldVector2Compact(scale, "Scale", 70);
        }
        else
        {
            MadGUI.PropertyFieldVector2Compact(position, "Position", 70);
        }

        EditorGUILayout.Space();

        MadGUI.PropertyField(followSpeed, "Follow Speed");
        MadGUI.PropertyFieldVector2Compact(scrollSpeed, "Auto Scroll", 70);

        if (serializedObject.ApplyModifiedProperties())
        {
            layer.SetDirty();
        }
    }
예제 #29
0
    public override void OnInspectorGUI()
    {
        SectionSprite(DisplayFlag.WithoutSize | DisplayFlag.WithoutMaterial | DisplayFlag.WithoutFill);

        serializedObject.Update();
        MadGUI.PropertyField(panel, "Panel", MadGUI.ObjectIsSet);
        EditorGUILayout.Space();

        MadGUI.PropertyField(font, "Font", MadGUI.ObjectIsSet);
        EditorGUILayout.LabelField("Text");
        text.stringValue = EditorGUILayout.TextArea(text.stringValue);
        MadGUI.PropertyField(scale, "Scale");
        MadGUI.PropertyField(align, "Align");
        MadGUI.PropertyField(letterSpacing, "Letter Spacing");
        MadGUI.PropertyField(wordWrap, "Word Wrap");
        MadGUI.Indent(() => {
            MadGUI.PropertyField(wordWrapLength, "Line Length");
        });

        serializedObject.ApplyModifiedProperties();
    }
    protected void LoadLevel()
    {
        MadGUI.PropertyFieldEnumPopup(loadLevel, "Load Level...");

        switch (s.loadLevel)
        {
        case MadLevelAbstractLayout.LoadLevel.Immediately:
            // do nothing
            break;

        case MadLevelAbstractLayout.LoadLevel.WithDelay:
            using (MadGUI.Indent()) {
                MadGUI.PropertyField(loadLevelLoadLevelDelay, "Delay");
                if (loadLevelLoadLevelDelay.floatValue < 0)
                {
                    loadLevelLoadLevelDelay.floatValue = Mathf.Max(0, loadLevelLoadLevelDelay.floatValue);
                }
            }
            break;

        case MadLevelAbstractLayout.LoadLevel.SendMessage:
            using (MadGUI.Indent()) {
                MadGUI.Info("By choosing this option you are responsible for loading the level. "
                            + "Activated MadLevelIcon will be passed as message argument.");

                MadGUI.PropertyField(loadLevelMessageReceiver, "Receiver", MadGUI.ObjectIsSet);
                MadGUI.PropertyField(loadLevelMessageName, "Method Name", MadGUI.StringNotEmpty);
                MadGUI.PropertyField(loadLevelMessageIncludeChildren, "Include Children");
            }
            break;

        case MadLevelAbstractLayout.LoadLevel.DoNotLoad:
            // do nothing
            break;

        default:
            Debug.LogError("Unknown option: " + s.loadLevel);
            break;
        }
    }