Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Check if the page is trusted
- bool ValidDomain()
- {
- #if UNITY_WEBGL && !UNITY_EDITOR
- System.Uri uri;
- // parse the page's address
- if (!System.Uri.TryCreate(Application.absoluteURL, System.UriKind.Absolute, out uri))
- return false;
- // check the host
- return uri.Scheme == "file" ||
- uri.Host == "localhost" ||
- uri.Host == "yourdomain.com" ||
- uri.Host == "ludumdare.com";
- #else
- return true;
- #endif
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement