Mouldi
1
HI,
Answering the question on your mind “YES I HAVE PRO” !!
So as i said it stick no matter what at 89% so i had to do some work around here my code:
IEnumerator Loading(string leveltoload)
{
do
{
loadingprog.value = (float)async.progress;
loadingpercent.text = (((int)(async.progress * 100)).ToString()) + " %";
Debug.Log(((int)(async.progress * 100)));
if (async.progress >= 0.89)
{
async.allowSceneActivation = true;
}
yield return null;
} while (!async.isDone);
yield return async;
}
my question is am i missing something or is it really a bug !! if yes please can anyone tell me how to do it the right way .
Thanks
Mouldi
2
yap here :
// Use this for initialization
void Start () {
it = Cache.get<InitialInterface>();
fbk = FBK.getInstance();
fbk.Connect();
app42 = App42.getInstance();
app42listner = App42Listner.getInstance();
app42listner.onConnect += onApp42ListnerConnectedHandler;
pho = PHO.getInstance();
StartCoroutine(Loading());
fbk.onConnect += onFBConnectedHandler;
}
private void onApp42ListnerConnectedHandler(bool isConnected)
{
if(isConnected)
{
Debug.Log("pio connected is " + isConnected + "and now connecting pho !!");
pho.Connect();
}
}
private void onFBConnectedHandler(bool isConnected)
{
if (isConnected)
{
Debug.Log("up and runing fb");
app42.Connect();
}
else
{
Debug.Log("fb not connected");
}
}
IEnumerator Loading()
{
do
{
loadingstate.text = fbk.LoadingState.ToString();
//************************************** loadingstate.text = pio.LoadingState.ToString();
loadingstate.text = pho.State();
loadingprog.value = (float)((it.StateProgress) );
loadingpercent.text = (((int)((it.StateProgress * 100) )).ToString()) + " %";
Debug.Log(it.StateProgress);
Debug.Log("fbk " + fbk.Connected);
//************************************ Debug.Log("pio " + pio.Connected);
Debug.Log("App42 " + app42listner.Connected);
Debug.Log("pho " + pho.Connected);
Debug.Log("it.ItemFinish " + it.ItemFinish);
Debug.Log("it.AchievementFinish " + it.AchievementFinish);
Debug.Log("it.BundleFinish " + it.BundleFinish);
Debug.Log("it.DownProg " + it.StateProgress);
yield return null;
}
while ((!fbk.Connected) || (!pho.Connected) || (!app42listner.Connected) || (!it.ItemFinish) || (!it.AchievementFinish) || (!it.BundleFinish)); //********************* || (!pio.Connected)
async = Application.LoadLevelAsync(leveltoload);
yield return async;
do
{
loadingstate.text = pho.State();
loadingprog.value = (float)((async.progress + it.StateProgress) / 2);
loadingpercent.text = (((int)((async.progress * 100 + it.StateProgress * 100) / 2)).ToString()) + " %";
Debug.Log(it.StateProgress);
Debug.Log("async " + async.isDone);
Debug.Log("async.progress " + async.progress);
Debug.Log("fbk " + fbk.Connected);
//********************************************************* Debug.Log("pio " + pio.Connected);
Debug.Log("pho " + pho.Connected);
Debug.Log("it.ItemFinish " + it.ItemFinish);
Debug.Log("it.AchievementFinish " + it.AchievementFinish);
Debug.Log("it.BundleFinish " + it.BundleFinish);
Debug.Log("it.DownProg " + it.StateProgress);
yield return null;
}
while ((!async.isDone) || (!fbk.Connected) || (!app42listner.Connected) || (!pho.Connected) || (!it.ItemFinish) || (!it.AchievementFinish) || (!it.BundleFinish)); //**************** || (!pio.Connected)
this is the current state of the class deleted some irrelevant methods but the essential is here