IsNaN
How do I use Is Na N
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
73 | if( float.IsNaN( targetPosition.x ) == false && float.IsNaN( targetPosition.z ) == false ) | 1 |
File name: PlayerDiamond.cs
Copy
62 void UpdateDiamondPosition()
63 {
64 Vector3 targetPosition = Vector3.zero;
65
66 if( HeadTransform != null )
67 {
68 targetPosition = HeadTransform.position;
69 }
70
71 targetPosition.y = m_Height;
72
73 if( float.IsNaN( targetPosition.x ) == false && float.IsNaN( targetPosition.z ) == false )
74 {
75 transform.position = Vector3.Lerp( transform.position, targetPosition, Time.deltaTime * 10f );
76 }
77 }
IsNaN 107 lượt xem
Gõ tìm kiếm nhanh...