예제 #1
0
    void SetPositions()
    {
        SoundtrackManager.s_instance.PlayAudioSource(SoundtrackManager.s_instance.bell);
        print("SET POS" + scenario);
        switch (scenario)
        {
        case 4:
        {
            hintText.text = "Remember: You give way to them.";
            MotorBoat.transform.position = overrun.position;
            MotorBoat.transform.rotation = overrun.rotation;
            Player.transform.rotation    = starboard.rotation;
            Player.transform.position    = starboard.position;
            MotorBoat.GetComponent <EvilYacht> ().isMoving = true;
            AIboat.SetActive(false);
            break;
        }

        case 2:
        {
            hintText.text    = "Remember: You give way to them.";
            boomSlider.value = 40f;
            AIboat.GetComponent <AIBoat> ().SetTack(false);
            Player.transform.position = windward.position;
            AIboat.transform.position = leeward.position;
            Player.transform.rotation = windward.rotation;
            AIboat.transform.rotation = leeward.rotation;
            AIboat.GetComponent <AIBoat> ().SetMast(scenario);
            currentGraphicCG = windward_LeewardGiveWayCG;

            break;
        }

        case 3:
        {
            hintText.text = "Remember: They give way to you.";
            StartCoroutine("level2");
            boomSlider.value          = 15f;
            Player.transform.rotation = leeward.rotation;
            Player.transform.position = leeward.position;
            AIboat.transform.rotation = windward.rotation;
            AIboat.transform.position = windward.position;
            AIboat.GetComponent <AIBoat> ().SetMast(scenario);

            currentGraphicCG = windward_LeewardStandOnCG;

            break;
        }

        case 0:
        {
            hintText.text = "Remember: They give way to you.";
            StartCoroutine("level3");

            boomSlider.value          = 20f;
            Player.transform.position = starboard.position;
            AIboat.transform.position = port.position;
            Player.transform.rotation = starboard.rotation;
            AIboat.transform.rotation = port.rotation;
            AIboat.GetComponent <AIBoat> ().SetMast(scenario);

            currentGraphicCG = port_StarboardStandOnCG;

            break;
        }

        case 1:
        {
            hintText.text             = "Remember: You give way to them.";
            boomSlider.value          = 14.5f;
            Player.transform.position = port.position;
            Player.transform.rotation = port.rotation;
            AIboat.transform.position = starboard.position;
            AIboat.transform.rotation = starboard.rotation;
            AIboat.GetComponent <AIBoat> ().SetMast(scenario);

            currentGraphicCG = port_StarboardGiveWayCG;

            break;
        }
        }
    }
예제 #2
0
 void ToggleBoatMovement(bool thisBool)
 {
     AIboat.GetComponent <Rigidbody> ().isKinematic    = !thisBool;
     Player.GetComponent <Rigidbody> ().isKinematic    = !thisBool;
     MotorBoat.GetComponent <Rigidbody> ().isKinematic = !thisBool;
 }