コード例 #1
0
 /// <summary>
 /// Create a new Vector3 based on the base Vector3, but with one axis value changed.
 /// </summary>
 /// <param name="baseV3">The base Vector3.</param>
 /// <param name="axis">The axis to change.</param>
 /// <param name="val">The new value of the axis to change.</param>
 /// <returns>A new Vector3 based on the base Vector3, but with one axis value changed.</returns>
 public static Vector3 CloneAndChange(Vector3 baseV3, V3Axis axis, float val)
 {
     return(new Vector3(
                axis == V3Axis.x ? val : baseV3.x,
                axis == V3Axis.y ? val : baseV3.y,
                axis == V3Axis.z ? val : baseV3.z
                ));
 }
コード例 #2
0
 public static Vector3 CloneAndChange(this Vector3 v3, V3Axis axis, float val)
 {
     return(new Vector3(
                axis == V3Axis.x ? val : v3.x,
                axis == V3Axis.y ? val : v3.y,
                axis == V3Axis.z ? val : v3.z
                ));
 }
コード例 #3
0
 /// <summary>
 /// Create a new Vector3 based on the base Vector3, but with one axis value changed.
 /// </summary>
 /// <param name="baseV3">The base Vector3.</param>
 /// <param name="axis">The axis to change.</param>
 /// <param name="val">The new value of the axis to change.</param>
 /// <returns>A new Vector3 based on the base Vector3, but with one axis value changed.</returns>
 public static Vector3 CloneAndChange(this Vector3 baseV3, V3Axis axis, float val)
 {
     return(Marvelous.CloneAndChange(baseV3, axis, val));
 }