public void OnNextClick( ) { int _currentStageIndex = (int)m_creatingStage; creators[_currentStageIndex].SetActive(false); if (_currentStageIndex == creators.Length - 1) { // now we has came the last stage of creating // the player name should not be null if (!PlayerData.GetInstance().GetPlayerName().Equals("")) { // The player has completed the class creating, and should be leaded to the game PlayerData.GetInstance().SaveAll(); //move the camera MovementPath mmPath = Camera.main.GetComponent <MovementPath>(); mmPath.enabled = true; mmPath.OnReach = JumpToGame; previousStageButton.gameObject.SetActive(false); nextStageButton.gameObject.SetActive(false); } return; } else { m_creatingStage = (CreatingStage)(++_currentStageIndex); creators[_currentStageIndex].SetActive(true); m_initFuncs[_currentStageIndex](); } }
public void OnPreviousClick( ) { int _currentStageIndex = (int)m_creatingStage; creators[_currentStageIndex].SetActive(false); if (_currentStageIndex == 0) { /* Return to the Main */ print("Return to main!"); // return to "start" scene return; } else { m_initFuncs[_currentStageIndex](); m_creatingStage = (CreatingStage)(--_currentStageIndex); creators[_currentStageIndex].SetActive(true); } }
public void OnNextClick( ) { int _currentStageIndex = (int)m_creatingStage; creators[_currentStageIndex].SetActive(false); if (_currentStageIndex == creators.Length - 1) { // now we has came the last stage of creating // the player name should not be null if (!PlayerData.GetInstance().GetPlayerName().Equals("")) { // The player has completed the class creating, and should be leaded to the game PlayerData.GetInstance().SaveAll(); //move the camera MovementPath mmPath = Camera.main.GetComponent<MovementPath>(); mmPath.enabled = true; mmPath.OnReach = JumpToGame; previousStageButton.gameObject.SetActive(false); nextStageButton.gameObject.SetActive(false); } return; } else { m_creatingStage = (CreatingStage)(++_currentStageIndex); creators[_currentStageIndex].SetActive(true); m_initFuncs[_currentStageIndex](); } }