IEnumerator WWWLoad(string shortName, bool bGenerated, OnLoadJS onLoadJS)
    {
        string fullName = JSMgr.getJSFullName(shortName, bGenerated);

        WWW www = new WWW(fullName);
        yield return www;

        if (www.error != null && www.error.Length > 0)
        {
            Debug.Log("Error loading JS: " + fullName + " " + www.error);
            onLoadJS(shortName, null, fullName);
        }
        else
        {
            onLoadJS(shortName, www.bytes, fullName);
        }
    }
 public void LoadJSSync(string shortName, bool bGenerated, OnLoadJS onLoadJS)
 {
     string fullName = JSMgr.getJSFullName(shortName, bGenerated);
     byte[] bytes = LoadJSSync(fullName);
     onLoadJS(shortName, bytes, fullName);
 }
 public void LoadJSAsync(string shortName, bool bGenerated, OnLoadJS onLoadJS)
 {
     StartCoroutine(WWWLoad(shortName, bGenerated, onLoadJS));
 }