/// <summary> /// Updates the object position based on input /// </summary> private void Move() { bool moveRight = false, moveLeft = false; if (Input.GetKey(m_keyMoveRight)) { moveRight = true; } if (Input.GetKey(m_keyMoveLeft)) { moveLeft = true; } // early out if (moveRight == moveLeft) { return; } Vector3 axis = RotationAxisHelper.AxisToVector3(m_axisOfTransformation, m_transformRotateAround); if (moveRight) { transform.RotateAround(m_transformRotateAround.position, axis, -m_speedRotate * Time.deltaTime); } if (moveLeft) { transform.RotateAround(m_transformRotateAround.position, axis, m_speedRotate * Time.deltaTime); } }
/// <summary> /// Updates all currently active bullets /// </summary> private void UpdateActiveBullets() { if (m_bulletPooler == null) return; for(int i = m_bulletPooler.ActiveCount - 1; i >= 0; --i) { Vector3 axis = RotationAxisHelper.AxisToVector3(m_axisOfTransformation, m_bulletPooler.GetActive(i).transform); m_bulletPooler.GetActive(i).transform.position += axis * Time.deltaTime * m_speedOfBullet; } }