void Update() { float delta = Time.deltaTime; float angle = 0.0f; IXVInput input = XVInput.GetInterface(UserID.User1); UpdatePosition(); if (m_slerpTime >= m_autoRotateTime) { angle = input.RotateCameraH() * m_rotateSpeed * delta; if (angle != 0.0f) { m_pivot.Rotate(Vector3.up, angle); } if (Input.GetKeyDown(KeyCode.U)) // TODO { m_slerpTime = 0.0f; } } else { m_slerpTime = (m_slerpTime + Time.deltaTime); m_pivot.rotation = Quaternion.Slerp(m_pivot.rotation, m_target.rotation, m_autoRotateSpeed * Time.deltaTime); } }
// Use this for initialization void Start() { m_lineRenderer.SetWidth(m_lineWidth, m_lineWidth); m_costBullet = this.m_bullet.GetComponent <BulletCtrl>().cost; m_costChargeBullet = this.m_bulletBouquet.GetComponent <BulletCtrl>().cost; m_pitchAngle = m_minPitchAngle; this.transform.Rotate(Vector3.right, m_pitchAngle, Space.Self); m_input = m_parent.GetComponent <UserData>().input; }