UnityEngine.Mathf.Round C# (CSharp) Method

Round() public static method

public static Round ( float f ) : float
f float
return float
        public static float Round(float f)
        {
            return (float)Math.Round(f);
        }

Usage Example

コード例 #1
0
        /// <summary>
        /// Converts a Vector3 to a Vector3i.
        /// </summary>
        /// <returns>
        /// The vector3i.
        /// </returns>
        /// <param name='inputVector'>
        /// Input Vector3.
        /// </param>
        public static Vector3i Vector3ToVector3i(UnityEngine.Vector3 inputVector)
        {
            int iX, iY, iZ;

            iX = (int)Mathf.Round(inputVector.x);
            iY = (int)Mathf.Round(inputVector.y);
            iZ = (int)Mathf.Round(inputVector.z);
            return(new Vector3i(iX, iY, iZ));
        }
All Usage Examples Of UnityEngine.Mathf::Round