GetRotation
How do I use Get Rotation
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
76 | transform.localRotation = m_RotationControl.GetRotation( transform.localRotation ); | 1 |
14 | public Quaternion GetRotation( Quaternion currentRotation ) | 2 |
File name: PhotonTransformView.cs
Copy
69 void UpdateRotation()
70 {
71 if( m_RotationModel.SynchronizeEnabled == false || m_ReceivedNetworkUpdate == false )
72 {
73 return;
74 }
75
76 transform.localRotation = m_RotationControl.GetRotation( transform.localRotation );
77 }
File name: PhotonTransformViewRotationControl.cs
Copy
14 public Quaternion GetRotation( Quaternion currentRotation )
15 {
16 switch( m_Model.InterpolateOption )
17 {
18 default:
19 case PhotonTransformViewRotationModel.InterpolateOptions.Disabled:
20 return m_NetworkRotation;
21 case PhotonTransformViewRotationModel.InterpolateOptions.RotateTowards:
22 return Quaternion.RotateTowards( currentRotation, m_NetworkRotation, m_Model.InterpolateRotateTowardsSpeed * Time.deltaTime );
23 case PhotonTransformViewRotationModel.InterpolateOptions.Lerp:
24 return Quaternion.Lerp( currentRotation, m_NetworkRotation, m_Model.InterpolateLerpSpeed * Time.deltaTime );
25 }
26 }
GetRotation 123 lượt xem
Gõ tìm kiếm nhanh...