Esempio n. 1
0
        /********************** RESETS *******************************/

        // DISABLES CAR-AI AND USER-DRIVING
        private void resetIntersectionScenario()
        {
            UserCar.SetActive(true);

            carAI.enabled = false;
            UserCar.GetComponent <CarUserControl> ().enabled = false;
            UserCar.GetComponent <CarUserControl> ().StopCar();

            CrazyIntersectionAI.SetActive(false);
            UnsuspectingAI.SetActive(false);

            UserCar.transform.position = new Vector3(26f, 0.26f, -18.3f);
            UserCar.transform.rotation = Quaternion.Euler(0f, 0f, 0f);

            carController.ResetSpeed();

            CrazyIntersectionAI.transform.position = new Vector3(43.6f, 0.01f, 65f);
            CrazyIntersectionAI.transform.rotation = Quaternion.Euler(0f, 270f, 0f);

            UnsuspectingAI.transform.position = new Vector3(-34f, 0.01f, 63.07f);
            UnsuspectingAI.transform.rotation = Quaternion.Euler(0f, 90f, 0f);

            hudController.Clear();

            // reset circuits
            crazyAI.Circuit           = crazyAI.Circuit;
            unsuspectingCarAI.Circuit = unsuspectingCarAI.Circuit;
        }
Esempio n. 2
0
        private void resetScenario()
        {
            userCarAI.enabled   = false;
            AIVehicleAI.enabled = false;

            UserCar.GetComponent <CarUserControl>().enabled = false;

            UserCar.GetComponent <CarUserControl>().StopCar();

            userCarController.ResetSpeed();
            AIVehicleCarController.ResetSpeed();

            hudController.Clear();

            if (mirror != null)
            {
                mirror.SetActive(false);
            }
            UserCar.SetActive(false);
            AIVehicle.SetActive(false);

            AIVehicle.transform.position = new Vector3(25.9f, 0.457f, 1f);
            AIVehicle.transform.rotation = Quaternion.Euler(0f, 0f, 0f);

            UserCar.transform.position = new Vector3(26f, 0.26f, -6f);
            UserCar.transform.rotation = Quaternion.Euler(0f, 0f, 0f);

            canPass = false;

            // reset circuits
            userCarAI.Circuit   = AITrack;
            AIVehicleAI.Circuit = UserTrack;
        }