예제 #1
0
    public void ClosedInstructionsPanel()
    {
        switch (curState)
        {
        case MOBState.briefing:
        {
            briefingUI.SetActive(false);
            setup1InstructionsUI.SetActive(true);
            curState = MOBState.setup1Instructions;
            break;
        }

        case MOBState.setup1Instructions:
        {
            setup1InstructionsUI.SetActive(false);
            gameplayUI.SetActive(true);
            StartGame();
            break;
        }

        case MOBState.setup2Instructions:
        {
            setup2InstructionsUI.SetActive(false);
            gameplayUI.SetActive(true);
            StartGame();
            break;
        }
        }
    }
예제 #2
0
    IEnumerator WinReset()
    {
        CameraOverhead();
        if (SoundtrackManager.s_instance != null)
        {
            SoundtrackManager.s_instance.PlayAudioSource(SoundtrackManager.s_instance.correct);
        }
        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;
            // Update UI state
            gameplayUI.SetActive(false);
            setup2InstructionsUI.SetActive(true);
            playerBoat.GetComponent <Rigidbody>().isKinematic = true;
            curState = MOBState.setup2Instructions;
        }
        else
        {
            curState = MOBState.win;
            if (SoundtrackManager.s_instance != null)
            {
                SoundtrackManager.s_instance.PlayAudioSource(SoundtrackManager.s_instance.bell);
            }
            CongratulationsPopUp.s_instance.InitializeCongratulationsPanel("Man Overboard");
        }
        isFailing = false;
    }
예제 #3
0
 public void ClosedInstructionsPanel()
 {
     switch( curState ) {
     case MOBState.briefing:
         {
             briefingUI.SetActive( false );
             setup1InstructionsUI.SetActive( true );
             curState = MOBState.setup1Instructions;
             break;
         }
     case MOBState.setup1Instructions:
         {
             setup1InstructionsUI.SetActive( false );
             gameplayUI.SetActive( true );
             StartGame();
             break;
         }
     case MOBState.setup2Instructions:
         {
             setup2InstructionsUI.SetActive( false );
             gameplayUI.SetActive( true );
             StartGame();
             break;
         }
     }
 }
예제 #4
0
    void Update()
    {
        switch (curState)
        {
        case MOBState.setup1Instructions:
        case MOBState.setup2Instructions:
        {
            if (switchToGamePlay)
            {
                playerBoat.GetComponent <Rigidbody> ().isKinematic = false;
                switchToGamePlay = false;
                curState         = MOBState.gameplay;
            }
            break;
        }

        case MOBState.gameplay:
        {
            if (switchToReset)
            {
                switchToReset = false;
                curState      = MOBState.reset;
            }
            break;
        }

        case MOBState.reset:
        {
//				StartCoroutine ("PauseBoats");
            if (switchToGamePlay)
            {
                switchToGamePlay = false;
                curState         = MOBState.gameplay;
                DieOnHitBoat[] arrows = GameObject.FindObjectsOfType <DieOnHitBoat> ();
                foreach (DieOnHitBoat x in arrows)
                {
                    x.Reset();
                }
                StartCoroutine("HackyBSFix");
            }
            break;
        }
        }
    }
예제 #5
0
    IEnumerator WinReset()
    {
        CameraOverhead ();
        if (SoundtrackManager.s_instance != null)
            SoundtrackManager.s_instance.PlayAudioSource (SoundtrackManager.s_instance.correct);
        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;
            // Update UI state
            gameplayUI.SetActive( false );
            setup2InstructionsUI.SetActive( true );
            playerBoat.GetComponent<Rigidbody>().isKinematic = true;
            curState = MOBState.setup2Instructions;

        } else {
            curState = MOBState.win;
            if (SoundtrackManager.s_instance != null)
                SoundtrackManager.s_instance.PlayAudioSource (SoundtrackManager.s_instance.bell);
            CongratulationsPopUp.s_instance.InitializeCongratulationsPanel( "Man Overboard" );
        }
        isFailing = false;
    }
예제 #6
0
 void Update()
 {
     switch (curState) {
     case MOBState.setup1Instructions:
     case MOBState.setup2Instructions:
         {
             if (switchToGamePlay) {
                 playerBoat.GetComponent<Rigidbody> ().isKinematic = false;
                 switchToGamePlay = false;
                 curState = MOBState.gameplay;
             }
             break;
         }
     case MOBState.gameplay:
         {
             if (switchToReset) {
                 switchToReset = false;
                 curState = MOBState.reset;
             }
             break;
         }
     case MOBState.reset:
         {
     //				StartCoroutine ("PauseBoats");
             if (switchToGamePlay) {
                 switchToGamePlay = false;
                 curState = MOBState.gameplay;
                 DieOnHitBoat[] arrows = GameObject.FindObjectsOfType<DieOnHitBoat> ();
                 foreach (DieOnHitBoat x in arrows) {
                     x.Reset ();
                 }
                 StartCoroutine ("HackyBSFix");
             }
             break;
         }
     }
 }