示例#1
0
        public static void ForEach(this Vector3Int thisVector, Action <Vector3Int> thisAction)
        {
            Vector3Int absVector = thisVector.Abs();
            Vector3Int direction = new Vector3Int(
                thisVector.x.Normalized(),
                thisVector.y.Normalized(),
                thisVector.z.Normalized()
                );

            for (int x = 0; x <= absVector.x; x++)
            {
                for (int y = 0; y <= absVector.y; y++)
                {
                    for (int z = 0; z <= absVector.z; z++)
                    {
                        thisAction(Vector3Int.Scale(new Vector3Int(x, y, z), direction));
                    }
                }
            }
        }