本文整理匯總了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);
}