IEnumerator DoLand(Tile currTile) { // displays tile text and reacts according to tile type yield return(new WaitForSeconds(moveDuration)); // play corresponding tile animation currTile.PlayEffect(); GameGUI.ShowMessageScreen(currTile); // play corresponding animation switch (currTile.GetTileType()) { case "jumpBack": DoSad(); break; case "finish": DoFinish(); break; case "jumpAhead": DoHappy(); break; default: break; } }
/*public void JumpToNextTile(int pathIndex) * { * // moves piece to another tile after landing * Tile nextTile = currTile.GetNext()[pathIndex]; * Vector3 currPos3d = new Vector3(currTile.GetPosition().x, 0, currTile.GetPosition().y); * Vector3 newPos3d = new Vector3(nextTile.GetPosition().x, 0, nextTile.GetPosition().y); * DoJump(currPos3d, newPos3d); * currTile = nextTile; * }*/ public void JumpToLandNextTile() { // moves piece to another tile after landing Tile nextTile = currTile.GetLandNext(); Vector3 currPos3d = new Vector3(currTile.GetPosition().x, 0, currTile.GetPosition().y); Vector3 newPos3d = new Vector3(nextTile.GetPosition().x, 0, nextTile.GetPosition().y); DoJump(currPos3d, newPos3d); currTile = nextTile; GameGUI.ShowMessageScreen(currTile); }