//-------------------------------------- // Capabilities //-------------------------------------- public static void AddCapability(ISD_CapabilityType capability, string entitlementsFilePath = "", bool addOptionalFramework = false) { ISD_Capability c = new ISD_Capability(); c.CapabilityType = capability; c.EntitlementsFilePath = entitlementsFilePath; c.AddOptionalFramework = addOptionalFramework; AddCapability(c); }
public static void AddCapability(ISD_Capability capability) { foreach (var cap in ISD_Settings.Instance.Capabilities) { if (cap.CapabilityType == capability.CapabilityType) { ISD_Settings.Instance.Capabilities.Remove(cap); break; } } ISD_Settings.Instance.Capabilities.Add(capability); }
public static void Capabilities() { SA_EditorGUILayout.Header("Capabilities"); SA_EditorGUILayout.ReorderablList(ISD_Settings.Instance.Capabilities, (ISD_Capability c) => { return(c.CapabilityType.ToString()); }, (ISD_Capability c) => { switch (c.CapabilityType) { case ISD_CapabilityType.PushNotifications: var settings = ISD_Settings.Instance.PushNotificationsCapabilitySettings; settings.Development = SA_EditorGUILayout.ToggleFiled("Development", settings.Development, SA_StyledToggle.ToggleType.YesNo); break; case ISD_CapabilityType.Cloud: var cloudSettings = ISD_Settings.Instance.iCloudCapabilitySettings; cloudSettings.KeyValueStorage = SA_EditorGUILayout.ToggleFiled("Key-value storage", cloudSettings.KeyValueStorage, SA_StyledToggle.ToggleType.EnabledDisabled); cloudSettings.iCloudDocument = SA_EditorGUILayout.ToggleFiled("iCloud Documents", cloudSettings.iCloudDocument, SA_StyledToggle.ToggleType.EnabledDisabled); break; default: EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Entitlements File Path"); c.EntitlementsFilePath = EditorGUILayout.TextField(c.EntitlementsFilePath); EditorGUILayout.EndHorizontal(); c.AddOptionalFramework = SA_EditorGUILayout.ToggleFiled("Add Optional Framework", c.AddOptionalFramework, SA_StyledToggle.ToggleType.YesNo); break; } } ); EditorGUILayout.BeginHorizontal(); s_newCap = (ISD_CapabilityType)EditorGUILayout.EnumPopup(s_newCap); if (GUILayout.Button("Add Capability", GUILayout.Height(20))) { ISD_Capability c = new ISD_Capability(); c.CapabilityType = s_newCap; ISD_Settings.Instance.Capabilities.Add(c); } EditorGUILayout.EndHorizontal(); }
public static void RemoveCapability(ISD_Capability capability) { RemoveCapability(capability.CapabilityType); }