コード例 #1
0
        void FixedUpdate()
        {
            if (m_playerPlane == null)
            {
                return;
            }

            if (!m_isActive)
            {
                return;
            }

            if (m_isTurningLeft && m_isAccelerating)
            {
                m_currentRotation += m_turnSpeed * 0.5f * Time.deltaTime;
            }
            else if (m_isTurningLeft)
            {
                m_currentRotation += m_turnSpeed * Time.deltaTime;
            }
            else if (m_isTurningRight && m_isAccelerating)
            {
                m_currentRotation -= m_turnSpeed * 0.5f * Time.deltaTime;
            }
            else if (m_isTurningRight)
            {
                m_currentRotation -= m_turnSpeed * Time.deltaTime;
            }

            m_playerPlane.Accelerate(m_acceleration, m_speedMultiplier);
            m_playerPlane.SetRotation(m_currentRotation);
        }