WAX Unity Web3 Suite
AtomicMarket
AtomicMarket
  • Getting Started
  • Installation
    • WebGL Installation
  • Examples
    • Unity examples
    • Available assets for trading
    • Filtered assets lists available for trading
    • AssetExample
    • AuctionExample
    • BuyOfferExample
    • SalesExample
  • API Docs
    • AtomicMarketApiFactory
    • Assets
      • AssetsApi
        • AssetDto
          • DataDto
            • BackedTokensDto
            • CollectionDto
            • SchemaDto
              • FormatDto
            • TemplateDto
            • ImmutableDataDto
        • AssetsDto
          • DataDto
            • BackedTokensDto
            • CollectionDto
            • SchemaDto
              • FormatDto
            • TemplateDto
              • ImmutableDataDto
      • AssetsUriParameterBuilder
    • Auctions
      • AuctionsApi
        • AuctionDto
          • DataDto
            • AssetDto
              • BackedTokensDto
              • SchemaDto
                • FormatDto
              • TemplateDto
                • ImmutableDataDto
              • BidsDto
              • CollectionDto
              • PriceDto
      • AuctionsDto
        • DataDto
          • AssetDto
            • BackedTokensDto
            • SchemaDto
              • FormatDto
            • TemplateDto
              • ImmutableDataDto
          • BidsDto
          • CollectionDto
          • PriceDto
      • AuctionsUriParameterBuilder
    • BuyOffers
      • BuyOffersApi
        • BuyOfferDto
          • DataDto
        • AssetDto
          • BackedTokensDto
          • SchemaDto
            • FormatDto
          • TemplateDto
            • ImmutableDataDto
        • CollectionDto
        • PriceDto
        • BuyOffersDto
          • DataDto
            • AssetDto
              • BackedTokensDto
              • SchemaDto
                • FormatDto
              • TemplateDto
                • ImmutableDataDto
            • CollectionDto
            • PriceDto
      • BuyOffersUriParameterBuilder
    • Config
      • ConfigApi
        • ConfigDto
          • DataDto
            • SupportedPairsDto
              • PairsDataDto
            • SupportedTokensDto
    • MarketPlaces
      • MarketPlacesApi
        • MarketplaceDto
          • DataDto
        • MarketplacesDto
          • DataDto
    • Offers
      • OffersApi
        • OfferDto
          • DataDto
            • AssetDto
              • BackedTokensDto
              • CollectionDto
              • SchemaDto
                • FormatDto
              • TemplateDto
                • ImmutableDataDto
        • OffersDto
          • DataDto
            • AssetDto
              • BackedTokensDto
              • CollectionDto
              • SchemaDto
                • FormatDto
              • TemplateDto
                • ImmutableDataDto
      • OffersUriParameterBuilder
    • Pricing
      • PricingApi
        • PricesDto
          • DataDto
        • AssetPricingDto
          • DataDto
        • TemplatesDto
          • DataDto
      • PricingUriParametersBuilder
    • Sales
      • SalesApi
        • SaleDto
          • DataDto
            • AssetDto
              • BackedTokensDto
              • SchemaDto
                • FormatDto
              • TemplateDto
                • ImmutableDataDto
            • CollectionDto
            • PriceDto
        • SalesDto
          • DataDto
            • AssetDto
              • BackedTokensDto
              • SchemaDto
                • FormatDto
              • TemplateDto
                • ImmutableDataDto
              • CollectionDto
              • PriceDto
      • SalesUriParameterBuilder
    • Stats
      • StatsApi
        • StatsDto
          • DataDto
        • AccountDto
          • DataDto
            • ResultDto
            • SymbolDto
        • AccountsDto
          • DataDto
            • ResultDto
            • SymbolDto
        • CollectionDto
          • DataDto
            • ResultDto
            • SymbolDto
        • CollectionsDto
          • DataDto
            • ResultDto
            • SymbolDto
        • GraphDto
          • DataDto
            • ResultDto
            • SymbolDto
        • SalesDto
          • DataDto
            • ResultDto
            • SymbolDto
        • SchemaDto
          • DataDto
            • ResultDto
            • SymbolDto
      • StatsUriParameterBuilder
    • Transfers
      • TransfersApi
        • TransfersDto
          • DataDto
            • AssetDto
              • BackedTokensDto
              • CollectionDto
              • SchemaDto
                • FormatDto
              • TemplateDto
                • ImmutableDataDto
      • TransfersUriParameterBuilder
    • Core
      • HttpRequestBuilder
      • HttpResponseMessageExtension
      • IUriParameterBuilder
    • LogsDto
      • DataDto
Powered by GitBook
On this page
Edit on GitHub
  1. Installation

WebGL Installation

PreviousInstallationNextExamples

Last updated 2 years ago

WebGL builds will require the index.html file to be customised.

Download the full customised file .

Ensure that this line is added to make websockets work.

window.unityInstance = unityInstance;
Further reading

WebAssembly for purposes does not have Networking-Capabilities.

Read more here: (https://webassembly.org/docs/security/)

Final script should have this included

      script.onload = () => {
        createUnityInstance(canvas, config, (progress) => {
          progressBarFull.style.width = 100 * progress + "%";
          }).then((unityInstance) => {
	  
	  // !!! IMPORTANT
	  window.unityInstance = unityInstance; // <-- THIS LINE MUST BE ADDED TO ENSURE WEBSOCKETS WORK!!!
          // !!! IMPORTANT
	  
          loadingBar.style.display = "none";
          fullscreenButton.onclick = () => {
          unityInstance.SetFullscreen(1);
          };
        }).catch((message) => {
          alert(message);
        });

Additional snippets

Unity WebGL requires an event listener to paste from the OS clipboard. Use the following structure in script.onload.

window.addEventListener('paste', function (e) {
      const str = e.clipboardData.getData('text');
      window.unityInstance.SendMessage('CanvasExample', 'OnBrowserClipboardPaste', str);
     });
here
security
Page cover image