Skip to content

Commit

Permalink
Update WebGL
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmfinol committed Nov 3, 2024
1 parent 9799aab commit 2ab8647
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 48 deletions.
8 changes: 0 additions & 8 deletions Assets/Plugins/WebGL.meta

This file was deleted.

5 changes: 0 additions & 5 deletions Assets/Plugins/WebGL/React.jslib

This file was deleted.

32 changes: 0 additions & 32 deletions Assets/Plugins/WebGL/React.jslib.meta

This file was deleted.

10 changes: 7 additions & 3 deletions Assets/Scripts/Cgs/Menu/GamesManagementMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

using System;
using System.IO;
using System.Linq;
using Cgs.UI;
using JetBrains.Annotations;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using UnityExtensionMethods;
Expand Down Expand Up @@ -57,10 +55,11 @@ public class GamesManagementMenu : SelectionPanel

private CardGameEditorMenu _cardGameEditor;

#if !UNITY_WEBGL
private DecisionModal ImportModal =>
_importModal ??= Instantiate(gameImportModalPrefab).GetOrAddComponent<DecisionModal>();

private DecisionModal _importModal;
#endif

private DownloadMenu Downloader => _downloader ??= Instantiate(downloadMenuPrefab)
.GetOrAddComponent<DownloadMenu>();
Expand Down Expand Up @@ -168,15 +167,20 @@ public void EditCurrent()
[UsedImplicitly]
public void Import()
{
#if UNITY_WEBGL
ShowDownloader();
#else
ImportModal.Show(ImportGamePrompt, new Tuple<string, UnityAction>(DownloadFromWeb, ShowDownloader),
new Tuple<string, UnityAction>(LoadFromFile, ShowFileLoader));
#endif
}

private void ShowDownloader()
{
Downloader.Show(DownloadLabel, DownloadPrompt, CardGameManager.Instance.GetCardGame, true);
}

// ReSharper disable once UnusedMember.Local
private static void ShowFileLoader()
{
#if UNITY_ANDROID || UNITY_IOS
Expand Down

0 comments on commit 2ab8647

Please sign in to comment.