本文整理汇总了C#中Chunk.SetFlag方法的典型用法代码示例。如果您正苦于以下问题:C# Chunk.SetFlag方法的具体用法?C# Chunk.SetFlag怎么用?C# Chunk.SetFlag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chunk
的用法示例。
在下文中一共展示了Chunk.SetFlag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RandomUpdate
//On random update spread grass to any nearby dirt blocks on the surface
public override void RandomUpdate(Chunk chunk, BlockPos pos, Block block)
{
for (int x = -1; x <= 1; x++)
{
for (int y = -1; y <= 1; y++)
{
for (int z = -1; z <= 1; z++)
{
if (chunk.GetBlock(pos.Add(x, y, z) - chunk.pos) == dirt
&& chunk.GetBlock(pos.Add(x, y + 1, z) - chunk.pos) == air)
{
chunk.SetBlock(pos.Add(x, y, z) - chunk.pos, "grass", false);
chunk.SetFlag(Chunk.Flag.updateSoon, true);
}
}
}
}
}
示例2: GenAndLoadChunk
/// <summary>
///Load terrain, saved changes and resets
///the light for an empty chunk
/// </summary>
/// <param name="chunk">The chunk to generate and load for</param>
protected virtual void GenAndLoadChunk(Chunk chunk)
{
if (chunk.pos.y == Config.Env.WorldMaxY)
{
terrainGen.GenerateTerrainForChunkColumn(chunk.pos);
for (int i = Config.Env.WorldMinY; i < Config.Env.WorldMaxY; i += Config.Env.ChunkSize)
Serialization.Load(GetChunk(new BlockPos(chunk.pos.x, i, chunk.pos.z)));
if (Config.Toggle.LightSceneOnStart)
BlockLight.ResetLightChunkColumn(this, chunk);
}
chunk.SetFlag(Chunk.Flag.terrainGenerated, true);
}