コード例 #1
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;
    }
コード例 #2
0
ファイル: MadFontInspector.cs プロジェクト: MatSe91/Lightbeam
    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;
    }
コード例 #3
0
ファイル: MadLevelMenu.cs プロジェクト: kewls74/game1
 static void CreateFont()
 {
     MadFontBuilder.CreateFont();
 }
コード例 #4
0
ファイル: MadFontInspector.cs プロジェクト: tng2903/game1
    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;
        }
        
        MadGUI.PropertyField(forceWhite, "Force White Color", "Forces this font to be rendered with white color only.");
        MadGUI.ConditionallyEnabled(!forceWhite.boolValue, () => {
            EditorGUI.BeginChangeCheck();
            primaryColor = EditorGUILayout.ColorField("Primary Color", primaryColor);
            secondaryColor = EditorGUILayout.ColorField("Primary 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;
    }