public void UpdateCamera(bool bOnlyZoom) { if (Camera.main == null) { return; } if (this.m_fWheelSpeed < 0f) { this.m_fWheelSpeed = 5f; } float num = this.m_fDistance / 8f; float fDistance = this.m_fDistance; if (this.m_TargetTrans) { this.m_fDistance = Mathf.Clamp(this.m_fDistance - Input.GetAxis("Mouse ScrollWheel") * this.m_fWheelSpeed * num, this.m_fDistanceMin, this.m_fDistanceMax); if (Camera.main.orthographic) { Camera.main.orthographicSize = this.m_fDistance * 0.6f; if (this.m_GrayscaleCamara != null) { this.m_GrayscaleCamara.orthographicSize = this.m_fDistance * 0.6f; } } if (!bOnlyZoom && this.m_bRightClick && Input.GetMouseButton(this.m_nRotInputIndex)) { this.m_fXRot += Input.GetAxis("Mouse X") * this.m_fXSpeed * 0.02f; this.m_fYRot -= Input.GetAxis("Mouse Y") * this.m_fYSpeed * 0.02f; } if (!bOnlyZoom && Input.GetMouseButtonDown(this.m_nRotInputIndex)) { this.m_bRightClick = true; } if (!bOnlyZoom && Input.GetMouseButtonUp(this.m_nRotInputIndex)) { this.m_bRightClick = false; } this.m_fYRot = FxmTestMouse.ClampAngle(this.m_fYRot, this.m_fYMinLimit, this.m_fYMaxLimit); Quaternion rotation = Quaternion.Euler(this.m_fYRot, this.m_fXRot, 0f); RaycastHit raycastHit; if (this.m_bRaycastHit && Physics.Linecast(this.m_TargetTrans.position, Camera.main.transform.position, out raycastHit)) { this.m_fDistance -= raycastHit.distance; } Vector3 point = new Vector3(0f, 0f, -this.m_fDistance); Vector3 position = rotation * point + this.m_TargetTrans.position; Camera.main.transform.rotation = rotation; Camera.main.transform.position = position; this.UpdatePosition(Camera.main.transform); if (this.m_GrayscaleCamara != null) { this.m_GrayscaleCamara.transform.rotation = Camera.main.transform.rotation; this.m_GrayscaleCamara.transform.position = Camera.main.transform.position; } if (fDistance != this.m_fDistance) { PlayerPrefs.SetFloat("FxmTestMouse.m_fDistance", this.m_fDistance); } } }
// ------------------------------------------------------------------------------------------- public FxmTestMouse GetFXMakerMouse() { if (m_FXMakerMouse == null) { m_FXMakerMouse = GetComponentInChildren <FxmTestMouse>(); } return(m_FXMakerMouse); }
public FxmTestMouse GetFXMakerMouse() { if (this.m_FXMakerMouse == null) { this.m_FXMakerMouse = base.GetComponentInChildren <FxmTestMouse>(); } return(this.m_FXMakerMouse); }
// ------------------------------------------------------------------------------------------- public FxmTestMouse GetFXMakerMouse() { if (m_FXMakerMouse == null) m_FXMakerMouse = GetComponentInChildren<FxmTestMouse>(); return m_FXMakerMouse; }