Add **Web platform with Emscripten**
This commit is contained in:
@@ -95,6 +95,8 @@ IMPLEMENT_ENGINE_SETTINGS_GETTER(SwitchPlatformSettings, SwitchPlatform);
|
||||
IMPLEMENT_ENGINE_SETTINGS_GETTER(MacPlatformSettings, MacPlatform);
|
||||
#elif PLATFORM_IOS
|
||||
IMPLEMENT_ENGINE_SETTINGS_GETTER(iOSPlatformSettings, iOSPlatform);
|
||||
#elif PLATFORM_WEB
|
||||
IMPLEMENT_ENGINE_SETTINGS_GETTER(WebPlatformSettings, WebPlatform);
|
||||
#else
|
||||
#error Unknown platform
|
||||
#endif
|
||||
@@ -280,6 +282,7 @@ void GameSettings::Deserialize(DeserializeStream& stream, ISerializeModifier* mo
|
||||
DESERIALIZE(PS5Platform);
|
||||
DESERIALIZE(MacPlatform);
|
||||
DESERIALIZE(iOSPlatform);
|
||||
DESERIALIZE(WebPlatform);
|
||||
}
|
||||
|
||||
#if USE_EDITOR
|
||||
|
||||
@@ -210,6 +210,14 @@ namespace FlaxEditor.Content.Settings
|
||||
public JsonAsset iOSPlatform;
|
||||
#endif
|
||||
|
||||
#if FLAX_EDITOR || PLATFORM_WEB
|
||||
/// <summary>
|
||||
/// Reference to <see cref="WebPlatformSettings"/> asset. Used to apply configuration on Web platform.
|
||||
/// </summary>
|
||||
[EditorOrder(2110), EditorDisplay("Platform Settings", "Web"), AssetReference(typeof(WebPlatformSettings), true), Tooltip("Reference to Web Platform Settings asset")]
|
||||
public JsonAsset WebPlatform;
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Gets the absolute path to the game settings asset file.
|
||||
/// </summary>
|
||||
@@ -345,6 +353,10 @@ namespace FlaxEditor.Content.Settings
|
||||
if (type == typeof(iOSPlatformSettings))
|
||||
return Load<iOSPlatformSettings>(gameSettings.iOSPlatform) as T;
|
||||
#endif
|
||||
#if FLAX_EDITOR || PLATFORM_WEB
|
||||
if (type == typeof(WebPlatformSettings))
|
||||
return Load<WebPlatformSettings>(gameSettings.WebPlatform) as T;
|
||||
#endif
|
||||
|
||||
if (gameSettings.CustomSettings != null)
|
||||
{
|
||||
@@ -443,6 +455,10 @@ namespace FlaxEditor.Content.Settings
|
||||
if (type == typeof(iOSPlatformSettings))
|
||||
return gameSettings.iOSPlatform;
|
||||
#endif
|
||||
#if FLAX_EDITOR || PLATFORM_WEB
|
||||
if (type == typeof(WebPlatformSettings))
|
||||
return gameSettings.WebPlatform;
|
||||
#endif
|
||||
|
||||
if (gameSettings.CustomSettings != null)
|
||||
{
|
||||
@@ -557,6 +573,8 @@ namespace FlaxEditor.Content.Settings
|
||||
return SaveAsset(gameSettings, ref gameSettings.MacPlatform, obj);
|
||||
if (type == typeof(iOSPlatformSettings))
|
||||
return SaveAsset(gameSettings, ref gameSettings.iOSPlatform, obj);
|
||||
if (type == typeof(WebPlatformSettings))
|
||||
return SaveAsset(gameSettings, ref gameSettings.WebPlatform, obj);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@ public:
|
||||
Guid PS5Platform;
|
||||
Guid MacPlatform;
|
||||
Guid iOSPlatform;
|
||||
Guid WebPlatform;
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
|
||||
@@ -38,3 +38,6 @@
|
||||
#if PLATFORM_IOS
|
||||
#include "Engine/Platform/iOS/iOSPlatformSettings.h"
|
||||
#endif
|
||||
#if PLATFORM_WEB
|
||||
#include "Engine/Platform/Web/WebPlatformSettings.h"
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user