public IEnumerator LoadPList() { //Load plist WWW www = new WWW(PListStaticURL); yield return(www); if (www.error != null) { Debug.Log(www.error); return(false); } //Parse plist Hashtable hashTable = new Hashtable(); PListManager.ParsePListText(www.text, ref hashTable); Debug.Log("start parse"); foreach (object key in hashTable.Keys) { if (key.Equals(CurrentStaticVersionNumber)) { Debug.Log("found PLIST version..." + key); Hashtable adTable = (Hashtable)hashTable[key]; adOnLoad1 = (AdValue)(adTable["AD_ON_LOAD1"]); adOnLoad2 = (AdValue)(adTable["AD_ON_LOAD2"]); adOnLoadFail = (AdValue)(adTable["AD_ON_LOAD_FAIL"]); adOnPause1 = (AdValue)(adTable["AD_ON_PAUSE1"]); adOnPause2 = (AdValue)(adTable["AD_ON_PAUSE2"]); adOnPauseFail = (AdValue)(adTable["AD_ON_PAUSE_FAIL"]); adOnReturn1 = (AdValue)(adTable["AD_ON_RETURN1"]); adOnReturn2 = (AdValue)(adTable["AD_ON_RETURN2"]); adOnReturnFail = (AdValue)(adTable["AD_ON_RETURN_FAIL"]); adOnGameOver1 = (AdValue)(adTable["AD_ON_GAMEOVER1"]); adOnGameOver2 = (AdValue)(adTable["AD_ON_GAMEOVER2"]); adOnGameOverFail = (AdValue)(adTable["AD_ON_GAMEOVER_FAIL"]); adBanner1 = (AdValue)(adTable["AD_BANNER1"]); adBanner2 = (AdValue)(adTable["AD_BANNER2"]); adBannerFail = (AdValue)(adTable["AD_BANNER_FAIL"]); adMoreGames1 = (AdValue)(adTable["AD_MORE_GAMES1"]); adMoreGames2 = (AdValue)(adTable["AD_MORE_GAMES2"]); adMoreGamesFail = (AdValue)(adTable["AD_MORE_GAMES_FAIL"]); adInReview = (AdValue)(adTable["AD_IN_REVIEW"]); Debug.Log("loaded PLIST complete"); break; //found version...exit loop } } Debug.Log(adInReview); Debug.Log("End of plist loading..."); }
// ----------------- LOAD PLIST INTO MEMORY ------------------- public IEnumerator LoadPList() { //Load plist WWW www = new WWW(PListStaticURL); yield return(www); if (www.error != null) { Debug.Log(www.error); yield break; } //Parse plist Hashtable hashTable = new Hashtable(); PListManager.ParsePListText(www.text, ref hashTable); Debug.Log("start parse"); foreach (object key in hashTable.Keys) { if (key.Equals(CurrentStaticVersionNumber)) { Debug.Log("found PLIST version..." + key); Hashtable adTable = (Hashtable)hashTable[key]; //NEW AD_BOOT_UP_ON = (AdValue)(adTable["AD_BOOT_UP_ON"]); AD_BOOT_UP_1 = (AdValue)(adTable["AD_BOOT_UP_1"]); AD_BOOT_UP_2 = (AdValue)(adTable["AD_BOOT_UP_2"]); AD_BOOT_UP_3 = (AdValue)(adTable["AD_BOOT_UP_3"]); AD_BOOT_UP_4 = (AdValue)(adTable["AD_BOOT_UP_4"]); AD_BOOT_UP_5 = (AdValue)(adTable["AD_BOOT_UP_5"]); AD_PAUSE_ON = (AdValue)(adTable["AD_PAUSE_ON"]); AD_PAUSE_1 = (AdValue)(adTable["AD_PAUSE_1"]); AD_PAUSE_2 = (AdValue)(adTable["AD_PAUSE_2"]); AD_PAUSE_3 = (AdValue)(adTable["AD_PAUSE_3"]); AD_PAUSE_4 = (AdValue)(adTable["AD_PAUSE_4"]); AD_PAUSE_5 = (AdValue)(adTable["AD_PAUSE_5"]); AD_GAMEOVER_ON = (AdValue)(adTable["AD_GAMEOVER_ON"]); AD_GAMEOVER_1 = (AdValue)(adTable["AD_GAMEOVER_1"]); AD_GAMEOVER_2 = (AdValue)(adTable["AD_GAMEOVER_2"]); AD_GAMEOVER_3 = (AdValue)(adTable["AD_GAMEOVER_3"]); AD_GAMEOVER_4 = (AdValue)(adTable["AD_GAMEOVER_4"]); AD_GAMEOVER_5 = (AdValue)(adTable["AD_GAMEOVER_5"]); AD_RETURN_ON = (AdValue)(adTable["AD_RETURN_ON"]); AD_RETURN_1 = (AdValue)(adTable["AD_RETURN_1"]); AD_RETURN_2 = (AdValue)(adTable["AD_RETURN_2"]); AD_RETURN_3 = (AdValue)(adTable["AD_RETURN_3"]); AD_RETURN_4 = (AdValue)(adTable["AD_RETURN_4"]); AD_RETURN_5 = (AdValue)(adTable["AD_RETURN_5"]); AD_BANNER_ON = (AdValue)(adTable["AD_BANNER_ON"]); AD_BANNER_1 = (AdValue)(adTable["AD_BANNER_1"]); AD_BANNER_2 = (AdValue)(adTable["AD_BANNER_2"]); AD_BANNER_3 = (AdValue)(adTable["AD_BANNER_3"]); AD_BANNER_4 = (AdValue)(adTable["AD_BANNER_4"]); AD_BANNER_5 = (AdValue)(adTable["AD_BANNER_5"]); AD_MOREGAMES_ON = (AdValue)(adTable["AD_MOREGAMES_ON"]); AD_MOREGAMES_1 = (AdValue)(adTable["AD_MOREGAMES_1"]); AD_MOREGAMES_2 = (AdValue)(adTable["AD_MOREGAMES_2"]); AD_MOREGAMES_3 = (AdValue)(adTable["AD_MOREGAMES_3"]); AD_MOREGAMES_4 = (AdValue)(adTable["AD_MOREGAMES_4"]); AD_MOREGAMES_5 = (AdValue)(adTable["AD_MOREGAMES_5"]); Debug.Log("loaded PLIST complete"); break; //found version...exit loop } } Debug.Log("End of plist loading..."); }