Esempio n. 1
0
    public void Generate(Grid3D grid)
    {
        var pattern = new PatternC();

        foreach (var instance in Instances)
        {
            var rotation = instance.Pose.rotation.eulerAngles.ToVector3Int();
            Debug.Log("imported rotation " + rotation);
            if (rotation.x == -90)
            {
                rotation.x = 270;
            }
            if (rotation.y == -90)
            {
                rotation.x = 270;
            }
            if (rotation.z == -90)
            {
                rotation.x = 270;
            }
            Debug.Log("adjusted rotation " + rotation);

            var block = new Block(pattern, instance.Pose.position.ToVector3Int(), rotation, grid);
            grid.AddBlockToGrid(block);
        }
    }