Пример #1
0
    public override void ReadVolxel(MVChunk chunk, int x, int y, int z, byte index)
    {
        Block block = chunk.GetBlock(x, y, z);

        if (index == 0)
        {
            block.Color.a = 255;
        }
        else
        {
            block.Color.a = index;
        }
        chunk.SetBlock(x, y, z, block);
    }
Пример #2
0
    public override void ReadVolxel(MVChunk chunk, int x, int y, int z, byte index)
    {
        Block block = chunk.GetBlock(x, y, z);

        block.Type = Block.BlockTypes.Solid;
        if (chunk.Palette.Length > index - 1)
        {
            block.Color = chunk.Palette[index - 1];
        }
        else
        {
            block.Color = Color.magenta;
            Debug.LogWarningFormat("MVChunk \"{0}\" palette has no color at index {1} (Array index {2})", chunk.Name, index, index - 1);
        }
        chunk.UpdateColorIndex(x, y, z, index);
        chunk.SetBlock(x, y, z, block);
    }