diff --git a/Carter Games/The Cart/Modules/Notion/Code/Editor/Cart Library/SettingsProviderNotionData.cs b/Carter Games/The Cart/Modules/Notion/Code/Editor/Cart Library/SettingsProviderNotionData.cs index feef24c4..0fc32316 100644 --- a/Carter Games/The Cart/Modules/Notion/Code/Editor/Cart Library/SettingsProviderNotionData.cs +++ b/Carter Games/The Cart/Modules/Notion/Code/Editor/Cart Library/SettingsProviderNotionData.cs @@ -71,7 +71,6 @@ public void OnInspectorSettingsGUI() EditorGUILayout.PropertyField(SettingsDef.ObjectRef.Fp("apiVersion")); EditorGUILayout.PropertyField(SettingsDef.ObjectRef.Fp("apiReleaseVersion")); - EditorGUILayout.PropertyField(SettingsDef.ObjectRef.Fp("notionApiKey"), AssetMeta.GetData("NotionData").Content("notion_defaultAPIKey")); if (EditorGUI.EndChangeCheck()) { @@ -104,8 +103,6 @@ public void OnProjectSettingsGUI() EditorGUILayout.PropertyField(SettingsDef.ObjectRef.Fp("apiVersion")); EditorGUILayout.PropertyField(SettingsDef.ObjectRef.Fp("apiReleaseVersion")); - EditorGUILayout.PropertyField(SettingsDef.ObjectRef.Fp("notionApiKey"), AssetMeta.GetData("NotionData").Content("notion_defaultAPIKey")); - if (EditorGUI.EndChangeCheck()) { diff --git a/Carter Games/The Cart/Modules/Notion/Code/Editor/Notion/Notion Api/Meta Data/NotionMetaData.cs b/Carter Games/The Cart/Modules/Notion/Code/Editor/Notion/Notion Api/Meta Data/NotionMetaData.cs index 38206a73..e29ecbb0 100644 --- a/Carter Games/The Cart/Modules/Notion/Code/Editor/Notion/Notion Api/Meta Data/NotionMetaData.cs +++ b/Carter Games/The Cart/Modules/Notion/Code/Editor/Notion/Notion Api/Meta Data/NotionMetaData.cs @@ -29,18 +29,6 @@ namespace CarterGames.Cart.Modules.NotionData.Editor { public static class NotionMetaData { - public static readonly GUIContent VersionNumber = - new GUIContent( - "Version:", - "The version number for the standalone asset."); - - - public static readonly GUIContent ReleaseDate = - new GUIContent( - "Release date (Y/M/D):", - "The release date of the standalone asset. In Year/Month/Day order."); - - public static readonly GUIContent ApiVersion = new GUIContent( "API version:", diff --git a/Carter Games/The Cart/Modules/Notion/Code/Editor/Settings/DataAssetSettingsNotionData.cs b/Carter Games/The Cart/Modules/Notion/Code/Editor/Settings/DataAssetSettingsNotionData.cs index d6c199be..1d75b031 100644 --- a/Carter Games/The Cart/Modules/Notion/Code/Editor/Settings/DataAssetSettingsNotionData.cs +++ b/Carter Games/The Cart/Modules/Notion/Code/Editor/Settings/DataAssetSettingsNotionData.cs @@ -40,7 +40,6 @@ public sealed class DataAssetSettingsNotionData : DataAsset [SerializeField] private NotionApiVersion apiVersion; [SerializeField] private NotionApiReleaseVersion apiReleaseVersion; - [SerializeField] private string notionApiKey; /* ───────────────────────────────────────────────────────────────────────────────────────────────────────────── | Properties @@ -56,12 +55,6 @@ public sealed class DataAssetSettingsNotionData : DataAsset /// The Notion API version to use. /// public NotionApiVersion NotionApiVersion => apiVersion; - - - /// - /// Gets the notion secret api key for use with the notion data asset system. - /// - public string NotionApiKey => notionApiKey; } } diff --git a/Carter Games/The Cart/Modules/Notion/Code/Runtime/Notion/Notion Database Handling/NotionDatabaseProperty.cs b/Carter Games/The Cart/Modules/Notion/Code/Runtime/Notion/Notion Database Handling/NotionDatabaseProperty.cs index e0c82b85..c8b4326c 100644 --- a/Carter Games/The Cart/Modules/Notion/Code/Runtime/Notion/Notion Database Handling/NotionDatabaseProperty.cs +++ b/Carter Games/The Cart/Modules/Notion/Code/Runtime/Notion/Notion Database Handling/NotionDatabaseProperty.cs @@ -135,6 +135,11 @@ public object GetValueAs(Type fieldType) { var combined = string.Empty; var elements = JSON.Parse(propertyValue).AsArray; + + if (elements.Count <= 1) + { + return Enum.Parse(fieldType, elements[0].Value.Replace(" ", "")); + } for (var index = 0; index < elements.Count; index++) { @@ -148,7 +153,16 @@ public object GetValueAs(Type fieldType) } else { - return Enum.Parse(fieldType, propertyValue.Replace(" ", "")); + try + { + return Enum.Parse(fieldType, propertyValue.Replace(" ", "")); + } +#pragma warning disable + catch (Exception e) +#pragma warning restore + { + return fieldType.IsValueType ? Activator.CreateInstance(fieldType) : null; + } } }