Skip to content

Instantly share code, notes, and snippets.

@grimmdev
Created May 14, 2015 03:18
Show Gist options
  • Save grimmdev/3aa425ccf55f84ced05a to your computer and use it in GitHub Desktop.
Save grimmdev/3aa425ccf55f84ced05a to your computer and use it in GitHub Desktop.
Sitelock Unity3D Web Player
// You'll have to call these functions atleast once, on load of the game just to ensure your work isn't being stolen.
using UnityEngine;
using System.Collections;
public class SiteLock {
public static void WWWLock (string Domain) {
Application.ExternalEval("if(document.location.host != '" + Domain + "') { document.location='" + Domain + "'; }");
}
public static void WWWLock (string Domain, string Redirect) {
Application.ExternalEval("if(document.location.host != '" + Domain + "') { document.location='" + Redirect + "'; }");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment