public static void DrawValueFiled(VariableListed var, string caption = "") { switch (var.Type) { case PlistValueTypes.Boolean: var.BooleanValue = EditorGUILayout.Toggle(var.BooleanValue); break; case PlistValueTypes.Float: var.FloatValue = EditorGUILayout.FloatField("Test", var.FloatValue); break; case PlistValueTypes.Integer: var.IntegerValue = EditorGUILayout.IntField(var.IntegerValue); break; case PlistValueTypes.String: var.StringValue = EditorGUILayout.TextField(var.StringValue); break; //Creating array and dictionary for info.plist case PlistValueTypes.Array: //TODO break; case PlistValueTypes.Dictionary: EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("something"); EditorGUILayout.EndHorizontal(); //TODO break; } }
private void DrawDictionaryValues(Variable var) { var.IsListOpen = EditorGUILayout.Foldout(var.IsListOpen, "Dictionary Values"); if (var.IsListOpen) { foreach (KeyValuePair <string, VariableListed> pair in var.DictionaryValue) { EditorGUI.indentLevel++; { EditorGUILayout.BeginHorizontal(); VariableListed v = pair.Value; v.IsOpen = EditorGUILayout.Foldout(v.IsOpen, v.DictKey); bool removed = DrawSortingButtons((object)v, var.ArrayValue); if (removed) { return; } EditorGUILayout.EndHorizontal(); if (v.IsOpen) { //EditorGUILayout.BeginHorizontal(); v.Type = (PlistValueTypes)EditorGUILayout.EnumPopup(v.Type); Debug.Log("v.Type " + v.Type); DrawValueFiled(v); //VALUE //EditorGUILayout.EndHorizontal(); } } EditorGUI.indentLevel--; } EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Add New Value With Key:"); newVarKey = EditorGUILayout.TextField(newVarKey); EditorGUILayout.Space(); if (GUILayout.Button("Add", GUILayout.Width(100))) { if (newVarKey.Length > 0) { VariableListed newDictValue = new VariableListed(); newDictValue.DictKey = newVarKey; var.AddVarToDictionary(newDictValue); } } EditorGUILayout.EndHorizontal(); } EditorGUILayout.Space(); }
public void AddVarToDictionary(VariableListed v) { bool valid = true; foreach (VariableListed var in DictValues) { if (var.DictKey.Equals(v.DictKey)) { valid = false; break; } } if (valid) { DictValues.Add(v); } }
public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject) { if (IOSNativeSettings.Instance.EnableInAppsAPI) { string StoreKit = "StoreKit.framework"; if (!SA.IOSDeploy.ISD_Settings.Instance.ContainsFreamworkWithName(StoreKit)) { SA.IOSDeploy.Framework F = new SA.IOSDeploy.Framework(); F.Name = StoreKit; SA.IOSDeploy.ISD_Settings.Instance.Frameworks.Add(F); } } if (IOSNativeSettings.Instance.EnableGameCenterAPI) { string GameKit = "GameKit.framework"; if (!SA.IOSDeploy.ISD_Settings.Instance.ContainsFreamworkWithName(GameKit)) { SA.IOSDeploy.Framework F = new SA.IOSDeploy.Framework(); F.Name = GameKit; SA.IOSDeploy.ISD_Settings.Instance.Frameworks.Add(F); } /* SA.IOSDeploy.Variable UIRequiredDeviceCapabilities = new SA.IOSDeploy.Variable(); * UIRequiredDeviceCapabilities.Name = "UIRequiredDeviceCapabilities"; * UIRequiredDeviceCapabilities.Type = SA.IOSDeploy.PlistValueTypes.Array; * UIRequiredDeviceCapabilities.ArrayType = SA.IOSDeploy.PlistValueTypes.String; * * SA.IOSDeploy.VariableListed gamekit = new SA.IOSDeploy.VariableListed(); * gamekit.StringValue = "gamekit"; * gamekit.Type = SA.IOSDeploy.PlistValueTypes.String; * UIRequiredDeviceCapabilities.ArrayValue.Add(gamekit); * * * * if(!SA.IOSDeploy.ISD_Settings.Instance.ContainsPlistVarkWithName(UIRequiredDeviceCapabilities.Name)) { * SA.IOSDeploy.ISD_Settings.Instance.PlistVariables.Add(UIRequiredDeviceCapabilities); * } */ } if (IOSNativeSettings.Instance.EnableSocialSharingAPI) { string Accounts = "Accounts.framework"; if (!SA.IOSDeploy.ISD_Settings.Instance.ContainsFreamworkWithName(Accounts)) { SA.IOSDeploy.Framework F = new SA.IOSDeploy.Framework(); F.Name = Accounts; SA.IOSDeploy.ISD_Settings.Instance.Frameworks.Add(F); } string SocialF = "Social.framework"; if (!SA.IOSDeploy.ISD_Settings.Instance.ContainsFreamworkWithName(SocialF)) { SA.IOSDeploy.Framework F = new SA.IOSDeploy.Framework(); F.Name = SocialF; SA.IOSDeploy.ISD_Settings.Instance.Frameworks.Add(F); } string MessageUI = "MessageUI.framework"; if (!SA.IOSDeploy.ISD_Settings.Instance.ContainsFreamworkWithName(MessageUI)) { SA.IOSDeploy.Framework F = new SA.IOSDeploy.Framework(); F.Name = MessageUI; SA.IOSDeploy.ISD_Settings.Instance.Frameworks.Add(F); } SA.IOSDeploy.Variable LSApplicationQueriesSchemes = new SA.IOSDeploy.Variable(); LSApplicationQueriesSchemes.Name = "LSApplicationQueriesSchemes"; LSApplicationQueriesSchemes.Type = SA.IOSDeploy.PlistValueTypes.Array; LSApplicationQueriesSchemes.ArrayType = SA.IOSDeploy.PlistValueTypes.String; SA.IOSDeploy.VariableListed instagram = new SA.IOSDeploy.VariableListed(); instagram.StringValue = "instagram"; instagram.Type = SA.IOSDeploy.PlistValueTypes.String; LSApplicationQueriesSchemes.ArrayValue.Add(instagram); SA.IOSDeploy.VariableListed whatsapp = new SA.IOSDeploy.VariableListed(); whatsapp.StringValue = "whatsapp"; whatsapp.Type = SA.IOSDeploy.PlistValueTypes.String; LSApplicationQueriesSchemes.ArrayValue.Add(whatsapp); if (!SA.IOSDeploy.ISD_Settings.Instance.ContainsPlistVarkWithName(LSApplicationQueriesSchemes.Name)) { SA.IOSDeploy.ISD_Settings.Instance.PlistVariables.Add(LSApplicationQueriesSchemes); } } if (IOSNativeSettings.Instance.EnableMediaPlayerAPI) { string MediaPlayer = "MediaPlayer.framework"; if (!SA.IOSDeploy.ISD_Settings.Instance.ContainsFreamworkWithName(MediaPlayer)) { SA.IOSDeploy.Framework F = new SA.IOSDeploy.Framework(); F.Name = MediaPlayer; SA.IOSDeploy.ISD_Settings.Instance.Frameworks.Add(F); } var NSAppleMusicUsageDescription = new SA.IOSDeploy.Variable(); NSAppleMusicUsageDescription.Name = "NSAppleMusicUsageDescription"; NSAppleMusicUsageDescription.StringValue = IOSNativeSettings.Instance.AppleMusicUsageDescription; NSAppleMusicUsageDescription.Type = SA.IOSDeploy.PlistValueTypes.String; if (!SA.IOSDeploy.ISD_Settings.Instance.ContainsPlistVarkWithName(NSAppleMusicUsageDescription.Name)) { SA.IOSDeploy.ISD_Settings.Instance.PlistVariables.Add(NSAppleMusicUsageDescription); } } if (IOSNativeSettings.Instance.EnableCameraAPI) { string MobileCoreServices = "MobileCoreServices.framework"; if (!SA.IOSDeploy.ISD_Settings.Instance.ContainsFreamworkWithName(MobileCoreServices)) { SA.IOSDeploy.Framework F = new SA.IOSDeploy.Framework(); F.Name = MobileCoreServices; SA.IOSDeploy.ISD_Settings.Instance.Frameworks.Add(F); } var NSCameraUsageDescription = new SA.IOSDeploy.Variable(); NSCameraUsageDescription.Name = "NSCameraUsageDescription"; NSCameraUsageDescription.StringValue = IOSNativeSettings.Instance.CameraUsageDescription; NSCameraUsageDescription.Type = SA.IOSDeploy.PlistValueTypes.String; if (!SA.IOSDeploy.ISD_Settings.Instance.ContainsPlistVarkWithName(NSCameraUsageDescription.Name)) { SA.IOSDeploy.ISD_Settings.Instance.PlistVariables.Add(NSCameraUsageDescription); } var NSPhotoLibraryUsageDescription = new SA.IOSDeploy.Variable(); NSPhotoLibraryUsageDescription.Name = "NSPhotoLibraryUsageDescription"; NSPhotoLibraryUsageDescription.StringValue = IOSNativeSettings.Instance.PhotoLibraryUsageDescription; NSPhotoLibraryUsageDescription.Type = SA.IOSDeploy.PlistValueTypes.String; if (!SA.IOSDeploy.ISD_Settings.Instance.ContainsPlistVarkWithName(NSPhotoLibraryUsageDescription.Name)) { SA.IOSDeploy.ISD_Settings.Instance.PlistVariables.Add(NSPhotoLibraryUsageDescription); } } if (IOSNativeSettings.Instance.EnableReplayKit) { Debug.Log("Replay Kit enabled"); string ReplayKit = "ReplayKit.framework"; if (!SA.IOSDeploy.ISD_Settings.Instance.ContainsFreamworkWithName(ReplayKit)) { SA.IOSDeploy.Framework F = new SA.IOSDeploy.Framework(); F.Name = ReplayKit; F.IsOptional = true; SA.IOSDeploy.ISD_Settings.Instance.Frameworks.Add(F); } } if (IOSNativeSettings.Instance.EnableCloudKit) { Debug.Log("Cloud Kit enabled"); string CloudKit = "CloudKit.framework"; if (!SA.IOSDeploy.ISD_Settings.Instance.ContainsFreamworkWithName(CloudKit)) { SA.IOSDeploy.Framework F = new SA.IOSDeploy.Framework(); F.Name = CloudKit; F.IsOptional = true; SA.IOSDeploy.ISD_Settings.Instance.Frameworks.Add(F); } string inheritedflag = "$(inherited)"; if (!SA.IOSDeploy.ISD_Settings.Instance.linkFlags.Contains(inheritedflag)) { SA.IOSDeploy.ISD_Settings.Instance.linkFlags.Add(inheritedflag); } } if (IOSNativeSettings.Instance.EnablePickerAPI) { string AssetsLibrary = "AssetsLibrary.framework"; if (!SA.IOSDeploy.ISD_Settings.Instance.ContainsFreamworkWithName(AssetsLibrary)) { SA.IOSDeploy.Framework F = new SA.IOSDeploy.Framework(); F.Name = AssetsLibrary; F.IsOptional = true; SA.IOSDeploy.ISD_Settings.Instance.Frameworks.Add(F); } } if (IOSNativeSettings.Instance.EnableContactsAPI) { string Contacts = "Contacts.framework"; if (!SA.IOSDeploy.ISD_Settings.Instance.ContainsFreamworkWithName(Contacts)) { SA.IOSDeploy.Framework F = new SA.IOSDeploy.Framework(); F.Name = Contacts; F.IsOptional = true; SA.IOSDeploy.ISD_Settings.Instance.Frameworks.Add(F); } string ContactsUI = "ContactsUI.framework"; if (!SA.IOSDeploy.ISD_Settings.Instance.ContainsFreamworkWithName(ContactsUI)) { SA.IOSDeploy.Framework F = new SA.IOSDeploy.Framework(); F.Name = ContactsUI; F.IsOptional = true; SA.IOSDeploy.ISD_Settings.Instance.Frameworks.Add(F); } var NSContactsUsageDescription = new SA.IOSDeploy.Variable(); NSContactsUsageDescription.Name = "NSContactsUsageDescription"; NSContactsUsageDescription.StringValue = IOSNativeSettings.Instance.CameraUsageDescription; NSContactsUsageDescription.Type = SA.IOSDeploy.PlistValueTypes.String; if (!SA.IOSDeploy.ISD_Settings.Instance.ContainsPlistVarkWithName(NSContactsUsageDescription.Name)) { SA.IOSDeploy.ISD_Settings.Instance.PlistVariables.Add(NSContactsUsageDescription); } } if (IOSNativeSettings.Instance.EnableSoomla) { string AdSupport = "AdSupport.framework"; if (!SA.IOSDeploy.ISD_Settings.Instance.ContainsFreamworkWithName(AdSupport)) { SA.IOSDeploy.Framework F = new SA.IOSDeploy.Framework(); F.Name = AdSupport; SA.IOSDeploy.ISD_Settings.Instance.Frameworks.Add(F); } string libsqlite3 = "libsqlite3.dylib"; if (!SA.IOSDeploy.ISD_Settings.Instance.ContainsLibWithName(libsqlite3)) { SA.IOSDeploy.Lib L = new SA.IOSDeploy.Lib(); L.Name = libsqlite3; SA.IOSDeploy.ISD_Settings.Instance.Libraries.Add(L); } #if UNITY_5 string soomlaLinkerFlag = "-force_load Libraries/Plugins/iOS/libSoomlaGrowLite.a"; #else string soomlaLinkerFlag = "-force_load Libraries/libSoomlaGrowLite.a"; #endif if (!SA.IOSDeploy.ISD_Settings.Instance.linkFlags.Contains(soomlaLinkerFlag)) { SA.IOSDeploy.ISD_Settings.Instance.linkFlags.Add(soomlaLinkerFlag); } } Debug.Log("ISN Postprocess Done"); }
public static void DrawDictionaryValues(Variable varr) { varr.IsListOpen = EditorGUILayout.Foldout(varr.IsListOpen, "Dictionary Values"); if (varr.IsListOpen) { foreach (Variable var in varr.PlistVariables) { EditorGUILayout.BeginVertical(GUI.skin.box); EditorGUILayout.BeginHorizontal(); string dictKey = "Key: " + var.Name; var.IsOpen = EditorGUILayout.Foldout(var.IsOpen, dictKey); EditorGUILayout.LabelField("(" + var.Type.ToString() + ")"); bool ItemWasRemoved = DrawSortingButtons((object)var, varr.PlistVariables); if (ItemWasRemoved) { return; } EditorGUILayout.EndHorizontal(); if (var.IsOpen) { EditorGUI.indentLevel++; { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Type"); var.Type = (PlistValueTypes)EditorGUILayout.EnumPopup(var.Type); EditorGUILayout.EndHorizontal(); if (var.Type == PlistValueTypes.String || var.Type == PlistValueTypes.Integer || var.Type == PlistValueTypes.Float || var.Type == PlistValueTypes.Boolean) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Value"); switch (var.Type) { case PlistValueTypes.Boolean: var.BooleanValue = EditorGUILayout.Toggle(var.BooleanValue); break; case PlistValueTypes.Float: var.FloatValue = EditorGUILayout.FloatField(var.FloatValue); break; case PlistValueTypes.Integer: var.IntegerValue = EditorGUILayout.IntField(var.IntegerValue); break; case PlistValueTypes.String: var.StringValue = EditorGUILayout.TextField(var.StringValue); break; } EditorGUILayout.EndHorizontal(); } else if (var.Type == PlistValueTypes.Array) { DrawArrayValues(var); } else if (var.Type == PlistValueTypes.Dictionary) { DrawDictionaryValues(var); } } EditorGUI.indentLevel--; } EditorGUILayout.EndVertical(); } EditorGUILayout.Space(); } EditorGUILayout.BeginVertical(GUI.skin.box); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel("New Key"); NewValueName = EditorGUILayout.TextField(NewValueName); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.Space(); if (GUILayout.Button("Add New Dictionary", GUILayout.Width(150))) { if (NewValueName.Length > 0) { Variable var = new Variable(); var.Name = NewValueName; varr.PlistVariables.Add(var); } NewValueName = string.Empty; } /////////// --------------------------------------------------------------------- foreach (KeyValuePair <string, VariableListed> pair in varr.DictionaryValue) { EditorGUI.indentLevel++; { EditorGUILayout.BeginHorizontal(); VariableListed v = pair.Value; string dictKey = "Key: " + v.DictKey; v.IsOpen = EditorGUILayout.Foldout(v.IsOpen, dictKey); bool removed = DrawSortingButtons((object)v, varr.ArrayValue); if (removed) { return; } if (v.IsOpen) { //EditorGUILayout.BeginHorizontal(); v.Type = (PlistValueTypes)EditorGUILayout.EnumPopup(v.Type); Debug.Log("v.Type " + v.Type); DrawValueFiled(v); //DRAW VALUE } EditorGUILayout.EndHorizontal(); } EditorGUI.indentLevel--; } EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); }