Esempio n. 1
0
        /// <summary>
        /// Adds compiler or linker flag to the build configuration
        /// </summary>
        /// <param name="name">flag name.</param>
        /// <param name="type">flag type.</param>
        public static void AddFlag(string name, XCodeFlagType type)
        {
            foreach (var flag in XCodeProjectSettings.Instance.Flags)
            {
                if (flag.Type == type && flag.Name.Equals(name))
                {
                    return;
                }
            }

            var newFlag = new XCodeProjectFlag();

            newFlag.Name = name;
            newFlag.Type = XCodeFlagType.LinkerFlag;

            XCodeProjectSettings.Instance.Flags.Add(newFlag);
        }
Esempio n. 2
0
        public void BuildFlags()
        {
            var linkerFlags = EditorAssetDatabase.GetTextureAtPath(XCodeWindowSkin.IconsPath + "linkerFlags.png");

            using (new IMGUIWindowBlockWithIndent(new GUIContent("Linker & Compiler Flags", linkerFlags)))
            {
                IMGUILayout.ReorderablList(XCodeProjectSettings.Instance.Flags,
                                           (XCodeProjectFlag flag) =>
                {
                    if (flag.Type.Equals(XCodeFlagType.CompilerFlag))
                    {
                        return(flag.Name + "     (Compiler)");
                    }
                    else
                    {
                        return(flag.Name + "     (Linker)");
                    }
                },
                                           (XCodeProjectFlag flag) =>
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Full Name:", GUILayout.Width(100));
                    flag.Name = EditorGUILayout.TextField(flag.Name, GUILayout.ExpandWidth(true));
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Type:", GUILayout.Width(100));

                    //flag.Type     = EditorGUILayout.TextField(flag.Type, GUILayout.ExpandWidth(true));
                    flag.Type = (XCodeFlagType)EditorGUILayout.EnumPopup(flag.Type);
                    EditorGUILayout.EndHorizontal();
                },
                                           () =>
                {
                    var newFlag  = new XCodeProjectFlag();
                    newFlag.Name = "New Flag";
                    XCodeProjectSettings.Instance.Flags.Add(newFlag);
                }
                                           );
            }

            EditorGUILayout.Space();
        }