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 virtual void Transition(CameraDefault from, float currentDistance, float desiredDistance, float correctedDistance) { transitioning = true; transitionTimeHolder = 0; this.currentDistance = currentDistance; this.desiredDistance = desiredDistance; this.correctedDistance = correctedDistance; tempYPositionOffset = from.tempYPositionOffset; tempXAngleOffset = from.tempXAngleOffset; tempZoomDistancecIdle = from.tempZoomDistancecIdle; tempZoomDistanceMoving = from.tempZoomDistanceMoving; }
protected override void OnSliderValueChanged(string _widgetName, float _value) { if (flag) { cameraDefault = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraDefault>(); flag = !flag; } switch (_widgetName) { case "BgSlider_M": bg.volume = _value; break; case "Sensitivity_M": cameraDefault.X_MouseSensitivity = _value; cameraDefault.Y_MouseSensitivity = _value; break; } // data.Bgvalue = _value; }
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); }
private void OnEnable() { camera = target as CameraDefault; }