コード例 #1
0
    public static async Task GrowTreeAsync(Vector position, BaseTree tree, int?heightOffset = null)
    {
        int offset;

        if (heightOffset is null)
        {
            offset = new Random().Next(-2, 2);
        }
        else
        {
            offset = (int)heightOffset;
        }
        await tree.TryGenerateTreeAsync(position, offset);
    }