コード例 #1
0
 public void DoSnapTurn(float angle)
 {
     if (m_lastSnapTurnTime + m_snapTurnDelay < Time.time)
     {
         SnapTurnFade(.2f);
         m_origin.RotatePlayer(Quaternion.Euler(new Vector3(0, angle, 0f)));
         m_lastSnapTurnTime = Time.time;
         OnSnapTurn?.Invoke();
     }
 }
コード例 #2
0
        public void DoSnapTurnTowards(Vector3 direction, float fadeDuration)
        {
            Vector3 deltaRot = Quaternion.LookRotation(direction).eulerAngles;

            deltaRot.x  = 0;
            deltaRot.z  = 0;
            deltaRot.y -= HMD.GetVRCameraEulerRelativeToFPSCameraParent().y;
            m_origin.RotatePlayer(Quaternion.Euler(deltaRot));
            SnapTurnFade(fadeDuration);
            OnSnapTurn.Invoke();
        }
コード例 #3
0
 internal void DoSmoothTurn(float angle)
 {
     m_origin.RotatePlayer(Quaternion.Euler(new Vector3(0, angle, 0f)));
     OnSnapTurn?.Invoke();
 }