Ejemplo n.º 1
0
        /// <summary>
        /// Adds a system framework dependency.
        ///
        /// The function assumes system frameworks are located in System/Library/Frameworks folder
        /// in the SDK source tree. The framework is added to Frameworks logical folder in the project.
        /// </summary>
        /// <param name="framework">framework configuration object</param>
        public static void AddFramework(ISD_Framework framework)
        {
            foreach (var item in ISD_Settings.Instance.Frameworks)
            {
                if (item.Type == framework.Type)
                {
                    ISD_Settings.Instance.Frameworks.Remove(item);
                    break;
                }
            }

            ISD_Settings.Instance.Frameworks.Add(framework);
        }
Ejemplo n.º 2
0
 private static bool IsAvailableOnPlatform(ISD_Framework framework, BuildTarget target)
 {
     if (target == BuildTarget.tvOS)
     {
         switch (framework.Type)
         {
         case ISD_iOSFramework.MessageUI:
         case ISD_iOSFramework.Contacts:
         case ISD_iOSFramework.ContactsUI:
         case ISD_iOSFramework.Social:
         case ISD_iOSFramework.Accounts:
             return(false);
         }
     }
     return(true);
 }
        public void Frameworks()
        {
            Texture2D framework_icon = SA_EditorAssets.GetTextureAtPath(ISD_Skin.ICONS_PATH + "frameworks.png");

            using (new SA_WindowBlockWithIndent(new GUIContent("Frameworks", framework_icon))) {
                IsDefFrameworksOpen = EditorGUILayout.Foldout(IsDefFrameworksOpen, "Show Default Unity Frameworks (17 Enabled)");
                if (IsDefFrameworksOpen)
                {
                    int indentLevel = EditorGUI.indentLevel;
                    EditorGUI.indentLevel = 0;
                    using (new SA_GuiBeginHorizontal()) {
                        GUILayout.Space(30);

                        using (new SA_GuiBeginVertical(GUI.skin.box)) {
                            foreach (ISD_Framework framework in ISD_FrameworkHandler.DefaultFrameworks)
                            {
                                SA_EditorGUILayout.SelectableLabel(framework.Type.ToString() + ".framework", "");
                            }
                        }
                    }

                    EditorGUI.indentLevel = indentLevel;
                    EditorGUILayout.Space();
                }


                IsDefLibrariesOpen = EditorGUILayout.Foldout(IsDefLibrariesOpen, "Default Unity Libraries (2 Enabled)");
                if (IsDefLibrariesOpen)
                {
                    int indentLevel = EditorGUI.indentLevel;
                    EditorGUI.indentLevel = 0;
                    using (new SA_GuiBeginHorizontal()) {
                        GUILayout.Space(30);

                        using (new SA_GuiBeginVertical(GUI.skin.box)) {
                            SA_EditorGUILayout.SelectableLabel("libiPhone-lib.a", "");
                            SA_EditorGUILayout.SelectableLabel("libiconv.2.dylib", "");
                        }
                    }
                    EditorGUI.indentLevel = indentLevel;


                    EditorGUILayout.Space();
                }

                //Frameworks List
                SA_EditorGUILayout.ReorderablList(ISD_Settings.Instance.Frameworks,
                                                  (ISD_Framework framework) => {
                    if (framework.IsOptional && framework.IsEmbeded)
                    {
                        return(framework.Name + "       (Optional & Embeded)");
                    }
                    else if (framework.IsOptional)
                    {
                        return(framework.Name + "        (Optional)");
                    }
                    else if (framework.IsEmbeded)
                    {
                        return(framework.Name + "        (Embeded)");
                    }
                    else
                    {
                        return(framework.Name);
                    }
                },
                                                  (ISD_Framework framework) => {
                    framework.IsOptional = SA_EditorGUILayout.ToggleFiled("Optional", framework.IsOptional, SA_StyledToggle.ToggleType.YesNo);
                    framework.IsEmbeded  = SA_EditorGUILayout.ToggleFiled("Embeded", framework.IsEmbeded, SA_StyledToggle.ToggleType.YesNo);
                }
                                                  );

                //Libraries List
                SA_EditorGUILayout.ReorderablList(ISD_Settings.Instance.Libraries,
                                                  (ISD_Library lib) => {
                    if (lib.IsOptional)
                    {
                        return(lib.Name + "    (Optional)");
                    }
                    else
                    {
                        return(lib.Name);
                    }
                },
                                                  (ISD_Library lib) => {
                    lib.IsOptional = SA_EditorGUILayout.ToggleFiled("Optional", lib.IsOptional, SA_StyledToggle.ToggleType.YesNo);
                }
                                                  );



                //Add New Framework
                EditorGUILayout.BeginHorizontal();
                NewBaseFrameworkIndex = EditorGUILayout.Popup(NewBaseFrameworkIndex, ISD_FrameworkHandler.BaseFrameworksArray());

                if (GUILayout.Button("Add Framework", EditorStyles.miniButton, GUILayout.Width(100)))
                {
                    var type = ISD_FrameworkHandler.BaseFrameworksArray()[NewBaseFrameworkIndex];
                    NewBaseFrameworkIndex = 0;

                    ISD_Framework f = new ISD_Framework(type);
                    ISD_API.AddFramework(f);
                }
                EditorGUILayout.EndHorizontal();


                //Add New Library
                EditorGUILayout.BeginHorizontal();
                NewLibraryIndex = EditorGUILayout.Popup(NewLibraryIndex, ISD_LibHandler.BaseLibrariesArray());

                if (GUILayout.Button("Add Library", EditorStyles.miniButton, GUILayout.Width(100)))
                {
                    ISD_iOSLibrary type = (ISD_iOSLibrary)ISD_LibHandler.enumValueOf(ISD_LibHandler.BaseLibrariesArray()[NewLibraryIndex]);
                    NewLibraryIndex = 0;
                    ISD_API.AddLibrary(type);
                }

                EditorGUILayout.EndHorizontal();
            }
        }