public void OnAwake(MonoBehaviour monoBehaviour) { pivot = monoBehaviour.transform.Find("Pivot").transform; camera = pivot.transform.Find("Camera") .GetComponent <Camera>(); leanPitchYawSmooth = pivot.GetComponent <LeanPitchYawSmooth>(); leanCameraMoveSmooth = pivot.GetComponent <LeanCameraMoveSmooth>(); leanCameraZoomSmooth = pivot.GetComponent <LeanCameraZoomSmooth>(); }
public void SetDefaultView() { SetDefaultRotation(); backButton.GetComponent <BackStage>().IsResult = false; ZoomScript = currentCamera.GetComponent <LeanCameraZoomSmooth>(); ZoomScript.Zoom = 120; LeanCameraMoveSmooth LCMS = currentCamera.GetComponent <LeanCameraMoveSmooth>(); LCMS.ClampPositionX_max = -20f; LCMS.ClampPositionX_min = -150f; currentCamera.transform.localEulerAngles = new Vector3(30f, 135f, 0f); currentCamera.transform.position = new Vector3(-95.11f, 186.56f, 118.63f); if (currentChar != null) { Destroy(currentChar); } currentChar = null; currentCamera.transform.localEulerAngles = new Vector3(0f, 0f, 0f); if (MainBuilding[0].activeSelf) { ShowOnlyTargetObject("MATH", "0"); } if (MainBuilding[1].activeSelf) { LCMS.ClampPositionX_max += 100f; currentCamera.GetComponent <LeanCameraMoveSmooth>().ClampPositionX_min += 100f; currentCamera.transform.position += new Vector3(100f, 0f, 0f); ShowOnlyTargetObject("CHEM2", "0"); } if (MainBuilding[2].activeSelf) { LCMS.ClampPositionX_max += 300f; LCMS.ClampPositionX_min += 300f; currentCamera.transform.position += new Vector3(300f, 0f, 0f); ShowOnlyTargetObject("MHMK", "0"); } if (MainBuilding[3].activeSelf) { LCMS.ClampPositionX_max += 400f; LCMS.ClampPositionX_min += 400f; currentCamera.transform.position += new Vector3(400f, 0f, 0f); ShowOnlyTargetObject("TAB", "0"); } currentCamera.transform.localEulerAngles = new Vector3(30f, 135f, 0f); moveView.SetActive(true); googleButton.SetActive(true); MainBuilding[0].GetComponent <Lean.Touch.LeanRotate>().enabled = true; MainBuilding[1].GetComponent <Lean.Touch.LeanRotate>().enabled = true; MainBuilding[2].GetComponent <Lean.Touch.LeanRotate>().enabled = true; MainBuilding[3].GetComponent <Lean.Touch.LeanRotate>().enabled = true; currentCamera.GetComponent <Lean.Touch.LeanCameraZoomSmooth>().enabled = true; currentCamera.GetComponent <Lean.Touch.LeanCameraMoveSmooth>().enabled = true; }