IEnumerator WinReset() { CameraOverhead(); yield return(new WaitForSeconds(3f)); if (setup2.activeSelf == false) { setup2.SetActive(true); setup1.SetActive(false); playerBoat.transform.position = setup2transform.position; playerBoat.transform.rotation = setup2transform.rotation; NavBoatControl.s_instance.respawnTransform = setup2transform; // UI gameplayUI.SetActive(false); jibingInformationUI.SetActive(true); playerBoat.GetComponent <Rigidbody>().isKinematic = true; curState = TackState.jibingIntro; // yield return new WaitForSeconds (2f); // CameraMain (); // switchToGamePlay = true; } else { curState = TackState.win; CongratulationsPopUp.s_instance.InitializeCongratulationsPanel("Tacking and Jibing"); } }
void Update() { switch (curState) { case TackState.tackingIntro: case TackState.jibingIntro: { if (switchToGamePlay) { playerBoat.GetComponent <Rigidbody> ().isKinematic = false; switchToGamePlay = false; curState = TackState.gameplay; } break; } case TackState.gameplay: { if (switchToReset) { switchToReset = false; curState = TackState.reset; } break; } case TackState.reset: { // StartCoroutine ("PauseBoats"); if (switchToGamePlay) { switchToGamePlay = false; curState = TackState.gameplay; DieOnHitBoat[] arrows = GameObject.FindObjectsOfType <DieOnHitBoat> (); foreach (DieOnHitBoat x in arrows) { x.Reset(); } } break; } } }
void Start() { curState = TackState.tackingIntro; }
IEnumerator WinReset() { CameraOverhead (); yield return new WaitForSeconds (3f); if (setup2.activeSelf == false) { setup2.SetActive (true); setup1.SetActive (false); playerBoat.transform.position = setup2transform.position; playerBoat.transform.rotation = setup2transform.rotation; NavBoatControl.s_instance.respawnTransform = setup2transform; // UI gameplayUI.SetActive( false ); jibingInformationUI.SetActive( true ); playerBoat.GetComponent<Rigidbody>().isKinematic = true; curState = TackState.jibingIntro; // yield return new WaitForSeconds (2f); // CameraMain (); // switchToGamePlay = true; } else { curState = TackState.win; CongratulationsPopUp.s_instance.InitializeCongratulationsPanel( "Tacking and Jibing" ); } }
void Update() { switch (curState) { case TackState.tackingIntro: case TackState.jibingIntro: { if (switchToGamePlay) { playerBoat.GetComponent<Rigidbody> ().isKinematic = false; switchToGamePlay = false; curState = TackState.gameplay; } break; } case TackState.gameplay: { if (switchToReset) { switchToReset = false; curState = TackState.reset; } break; } case TackState.reset: { // StartCoroutine ("PauseBoats"); if (switchToGamePlay) { switchToGamePlay = false; curState = TackState.gameplay; DieOnHitBoat[] arrows = GameObject.FindObjectsOfType<DieOnHitBoat> (); foreach (DieOnHitBoat x in arrows) { x.Reset (); } } break; } } }