コード例 #1
0
    private void DrawBuildTargetGroup(BuildTargetGroup buildTargetGroup, ref string newDefine)
    {
        EditorGUILayout.BeginVertical();

        EditorGUILayout.LabelField(string.Format("Platform: {0}", buildTargetGroup.ToString()), EditorStyles.boldLabel);
        EditorGUILayout.LabelField("Define symbols:", EditorStyles.boldLabel);
        EditorGUILayout.Space();

        EditorGUILayout.BeginHorizontal();
        newDefine = EditorGUILayout.TextField(newDefine);
        EditorGUI.BeginDisabledGroup(string.IsNullOrEmpty(newDefine));
        if (GUILayout.Button("Add"))
        {
            DefinesEditor.AddDefine(buildTargetGroup, newDefine);
            newDefine = string.Empty;
        }
        EditorGUI.EndDisabledGroup();
        EditorGUILayout.EndHorizontal();

        var defines = DefinesEditor.GetDefines(buildTargetGroup);

        foreach (var define in defines)
        {
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField(define);
            if (GUILayout.Button("Remove"))
            {
                DefinesEditor.RemoveDefine(buildTargetGroup, define);
            }
            EditorGUILayout.EndHorizontal();
        }
        DrawCommonDefines(buildTargetGroup, defines);

        EditorGUILayout.EndVertical();
    }
コード例 #2
0
    private void DrawCommonDefines(BuildTargetGroup buildTargetGroup, List <string> defines)
    {
        EditorGUILayout.Space();
        EditorGUILayout.LabelField("Common defines:", EditorStyles.boldLabel);

        foreach (var define in _commonDefines)
        {
            if (defines.Contains(define))
            {
                continue;
            }

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField(define);
            if (GUILayout.Button("Add"))
            {
                DefinesEditor.AddDefine(buildTargetGroup, define);
            }
            EditorGUILayout.EndHorizontal();
        }
    }