public void SetCarAndMan() { if (CurrentCar.GetComponent <MoveCar>().IsTaskedCar) { audioSource.clip = ClipCarAndMan; audioSource.Play(); timeCurrentDay.StopTimeDay(); CameraScenePolice.SetActive(true); CameraDefault.SetActive(false); CurrentMan = Instantiate(Mans[Random.Range(0, Mans.Length)], SpawnManTrans.position, SpawnManTrans.rotation); CurrentMan.transform.localScale = new Vector3(6.253749f, 6.253749f, 6.253749f); CurrentCar.GetComponent <MoveCar>().IsStopped = true; CurrentCar.GetComponent <MoveCar>().NoDestroy = true; CurrentCar.transform.position = SetPosCarTrans.position; CurrentCar.transform.rotation = SetPosCarTrans.rotation; ParentSelectMiniGame.SetActive(true); ParentCurrentTasks.SetActive(false); int r = Random.Range(0, 2); if (r == 0) { ButAlco.onClick.Invoke(); } if (r == 1) { ButRengen.onClick.Invoke(); } } else { PlayerPrefs.SetFloat(Constants.Money, PlayerPrefs.GetInt(Constants.Money) - 100); ParentFine.SetActive(true); Invoke("ResetFade", 2f); } }
public void EnablePoliceCarMove() { generatorMap.GenerateCars(); CameraDefault.SetActive(false); StatickPolice.SetActive(false); CameraMove.SetActive(true); MovePolice.SetActive(true); CurrentCar.transform.position = new Vector3(MovePolice.transform.position.x, MovePolice.transform.position.y, MovePolice.transform.position.z - 1800f); }
public void GoCameraDefault() { ParetTime.SetActive(true); timeCurrentDay.StartTimeDay(); CameraScenePolice.SetActive(false); CameraDefault.SetActive(true); Destroy(CurrentMan); Destroy(CurrentCar); ParentSelectMiniGame.SetActive(false); ParentCurrentTasks.SetActive(true); rayTapCar.IsBlocked = false; MiniGameRengen.SetActive(false); MiniGameRengenButtons.SetActive(false); generatorMap.SetDefaultPos(); StatickPolice.SetActive(true); CameraMove.SetActive(false); MovePolice.SetActive(false); generatorManager.DestroyAllCars(false); CameraMove.transform.position = posCamChase; MovePolice.transform.position = posPolice; generatorManager.StartGenerate(); generatorMap.ParentBordersTrigger.SetActive(true); }