예제 #1
0
 public static Vector3Int ToVector3Int(this Vector2Int vector, Vector3Axis to_add, int fill_with = 0)
 {
     if (to_add == Vector3Axis.x)
     {
         return(new Vector3Int(fill_with, vector.x, vector.y));
     }
     else if (to_add == Vector3Axis.y)
     {
         return(new Vector3Int(vector.x, fill_with, vector.y));
     }
     else
     {
         return(new Vector3Int(vector.x, vector.y, fill_with));
     }
 }
예제 #2
0
 public static Vector2Int ToVector2Int(this Vector3Int vector, Vector3Axis to_drop)
 {
     if (to_drop == Vector3Axis.x)
     {
         return(new Vector2Int(vector.y, vector.z));
     }
     else if (to_drop == Vector3Axis.y)
     {
         return(new Vector2Int(vector.x, vector.z));
     }
     else
     {
         return(new Vector2Int(vector.x, vector.y));
     }
 }