Add iOS platform (refactor Mac into shared Apple platform impl)

This commit is contained in:
Wojtek Figat
2023-03-15 20:57:44 +01:00
parent dc29ee180e
commit 0ba261d338
84 changed files with 2806 additions and 1623 deletions

View File

@@ -71,6 +71,8 @@ IMPLEMENT_ENGINE_SETTINGS_GETTER(AndroidPlatformSettings, AndroidPlatform);
IMPLEMENT_ENGINE_SETTINGS_GETTER(SwitchPlatformSettings, SwitchPlatform);
#elif PLATFORM_MAC
IMPLEMENT_ENGINE_SETTINGS_GETTER(MacPlatformSettings, MacPlatform);
#elif PLATFORM_IOS
IMPLEMENT_ENGINE_SETTINGS_GETTER(iOSPlatformSettings, iOSPlatform);
#else
#error Unknown platform
#endif
@@ -254,6 +256,7 @@ void GameSettings::Deserialize(DeserializeStream& stream, ISerializeModifier* mo
DESERIALIZE(SwitchPlatform);
DESERIALIZE(PS5Platform);
DESERIALIZE(MacPlatform);
DESERIALIZE(iOSPlatform);
}
void LayersAndTagsSettings::Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)

View File

@@ -202,6 +202,14 @@ namespace FlaxEditor.Content.Settings
public JsonAsset MacPlatform;
#endif
#if FLAX_EDITOR || PLATFORM_IOS
/// <summary>
/// Reference to <see cref="iOSPlatformSettings"/> asset. Used to apply configuration on iOS platform.
/// </summary>
[EditorOrder(2100), EditorDisplay("Platform Settings", "iOS"), AssetReference(typeof(iOSPlatformSettings), true), Tooltip("Reference to iOS Platform Settings asset")]
public JsonAsset iOSPlatform;
#endif
/// <summary>
/// Gets the absolute path to the game settings asset file.
/// </summary>
@@ -333,6 +341,10 @@ namespace FlaxEditor.Content.Settings
if (type == typeof(MacPlatformSettings))
return Load<MacPlatformSettings>(gameSettings.MacPlatform) as T;
#endif
#if FLAX_EDITOR || PLATFORM_IOS
if (type == typeof(iOSPlatformSettings))
return Load<iOSPlatformSettings>(gameSettings.iOSPlatform) as T;
#endif
if (gameSettings.CustomSettings != null)
{
@@ -427,6 +439,10 @@ namespace FlaxEditor.Content.Settings
if (type == typeof(MacPlatformSettings))
return gameSettings.MacPlatform;
#endif
#if FLAX_EDITOR || PLATFORM_IOS
if (type == typeof(iOSPlatformSettings))
return gameSettings.iOSPlatform;
#endif
if (gameSettings.CustomSettings != null)
{
@@ -539,6 +555,8 @@ namespace FlaxEditor.Content.Settings
return SaveAsset(gameSettings, ref gameSettings.Audio, obj);
if (type == typeof(MacPlatformSettings))
return SaveAsset(gameSettings, ref gameSettings.MacPlatform, obj);
if (type == typeof(iOSPlatformSettings))
return SaveAsset(gameSettings, ref gameSettings.iOSPlatform, obj);
return true;
}

View File

@@ -84,6 +84,7 @@ public:
Guid SwitchPlatform;
Guid PS5Platform;
Guid MacPlatform;
Guid iOSPlatform;
public:

View File

@@ -35,3 +35,6 @@
#if PLATFORM_MAC
#include "Engine/Platform/Mac/MacPlatformSettings.h"
#endif
#if PLATFORM_IOS
#include "Engine/Platform/iOS/iOSPlatformSettings.h"
#endif