// Update is called once per frame void Update() { if (tpm.getPlayed() == true && PlayAnim == true) { timer = timer + Time.deltaTime; if (currentFrame < foodStomach.Length) { i.sprite = foodStomach [currentFrame]; if (timer >= frameTime) { timer = 0; currentFrame++; } } else { animPlayed = true; } } }
// Update is called once per frame void Update() { secLastPlayed = tps.getPlayed(); if (currentLevel == 1) { secLastPlayed = tpm.getPlayed(); } else if (currentLevel == 2) { secLastPlayed = tps.getPlayed(); } else if (currentLevel == 3) { secLastPlayed = tpsi.getPlayed(); } if (secLastPlayed) { timer = timer + Time.deltaTime; if (currentFrame < (currentLevel - 1) * 2 + 2) { i.sprite = BGs [currentFrame]; if (timer >= frameTime) { timer = 0; currentFrame++; counter++; tqm.setFrame(1); } } else { currentFrame = (currentLevel - 1) * 2; counter++; tqm.setFrame(0); } } if (counter >= totalTimes * 2) { if (currentLevel == 1) { Application.LoadLevel("StomachStoryboard"); } else if (currentLevel == 2) { //Application.LoadLevel("SmallIntestineStoryboard"); Application.LoadLevel("Test_SIStoryBoard"); } else if (currentLevel == 3) { Application.LoadLevel("LargeIntestineStoryboard"); } } }