Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by _watcher_ · Jan 19, 2021 at 02:08 PM · webgllink

Deeplinking WebGL build (aka Flash's SWFAddress) ?

Hey!

I know non-webGL builds have some kind of deep linking implementation https://docs.unity3d.com/Manual/enabling-deep-linking.html

How about WebGL? Unless such plugin/functionality (even 3rd party) exists, ill have to do it myself.

I understand Flash had its own Javascript+Actionscript implementation to do it (and also PHP mirrored data model for SEO).

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Bunny83 · Jan 19, 2021 at 03:50 PM

This doesn't make much sense ^^. First of all usual Deep linking in the context of websites is something different that deep linking in the context of mobile apps. In the second case it's about registrating a new URL scheme (in case of Unity the "unitydl" scheme) by the OS so when such an URL is encountered the OS will start a certain registrated application and pass the information in the URL to that application.

In the context of websites that doesn't really make much sense since web content is already hosted on a web server and only available through a link to the server where it's hosted. For example this is my parallel Mandelbrot Renderer hosted on github pages. My WebGL application does recognise custom properties in the URL and parses it at load. For example this one. So when opening the webgl application with this link it will automatically center on the given complex number and start rendering at the given zoom level.


If you want to do something similar my URLParameters singleton script is over here. I've found this old question where I explain the class a bit more in detail. Note that there's an old and a new version of the script. The old one used ExternalEval to directly execute JS code in the browser. Since that has been deprecated we have to use a seperate jslib plugin file. My URLParameters script will automatically extract the embedded jslib when you import the script in the editor. It does check the existance of the jslib every time the editor / project is loaded and if it's missing it will extract the file.


You can also use this class to set the hash / URL fragment from script. This is what my Mandelbrot renderer does every time you change the view / zoom.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bunny83 · Jan 19, 2021 at 04:05 PM 0
Share

I just realised that you probably are talking about normal "deep linking". As I essentially have explained you can use the URL fragment to dynamically update your content based on that. Keep in $$anonymous$$d when you actually change the URL (anything before the fragment "#") the browser will reload the page and your Unity WebGL content has to be reloaded as well.


If you want to the user to be able to click on a link on your webpage that has a different fragment or the user should be allowed to change the fragment in the URL manually, you can listen to the onhashchange callback of your browser in javascript and forward this callback to Unity through Send$$anonymous$$essage,


Note that it is not possible to register a new scheme for a website. What you could do is having a special "redirect link page" so when the user opens this special page, the page itself will look for other tabs / windows where your main content may run, communicate it's parameters to the main page and close itself. If no such tab / window exists it could simply redirect to the main page and load the actual webgl application that way. This would be kind of like mobile deep linking. However it depends on your specific needs and usecases.

avatar image
0

Answer by _watcher_ · Jan 19, 2021 at 07:53 PM

Hot stuff!

Thank you @Bunny83, you are a godsend as always. Yes i ment the 'normal deep linking' with the hash fragment, as you explained in your second message. That's why a php mirror of the data model, for creating a crawlable content - but i think it might get blacklisted by googlul for ghosting. Either way, that's how SWFAddress did it.

The onhashchange callback is what i was looking for, cheers!

PS your Mandelbrot app reminds me of the good ol' uni days, i also wanted to recreate it in Unity once i got some time, but now i don't have to, i can simply dig into your code <3

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

116 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to open a Webgl unity game from a different html page? 1 Answer

Open WebGL link different from the domain i'm running my gam 0 Answers

Dynamic link url and text in WebGL build 2 Answers

WebGL build with SCORM 1.2 is not working in LMS 1 Answer

i found this error when loading WebGL build in chrome - 64 bit. 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges