public bool goToNextLevel() { bool rc = true; //int currentLevel = Utility.CurrentSceneIndex; //int courseLevel = getHoleNomUsingCourse(); int courseLevel = getHoleNomUsingCourse(); int currentLevel = m_courceController.currentHoleIndex; updateScores(courseLevel); TransitionScript ts = (TransitionScript)GameObject.FindObjectOfType(typeof(TransitionScript)); Constants.setLastSceneIndex(currentLevel + 1); if (courseLevel + 1 < HOLES_PER_COURSE + 1) { GameManager.nextScene(); /* * if (ts) * { * loadLevel(ts.sceneIndex); * } * else * { * loadLevel(currentLevel + 1); * } */ m_courceController.LoadNextHole(); currentNumberOfStrokes = 0; //get a ref to the gamescript! GameObject go = GameObject.FindWithTag("Player"); if (go) { m_ballScript = go.GetComponent <BallScript>(); } BaseGameManager.gameover(false); GolfManager.startHole(); } else { if (Constants.getPracticeMode() == false) { BaseGameManager.submitSate(); GameManager.enterState(GameScript.State.SUBMTSCORE.ToString()); } else { loadLevel(0); } rc = false; } return(rc); }
public void startHoleRPC() { Debug.Log("startHole"); //lets send our start hole. m_startedHole = true; GolfManager.startHole(); //only use the shot clock if we want to use it and the player is online with another player. if (useShotClock && PhotonNetwork.offlineMode == false) { if (PhotonNetwork.isMasterClient) { m_shotClock = shotClock; stopClock(); StartCoroutine(ShotClockIE()); } } }