Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
LeavesBlock.cs
浏览该文件的文档.
1using Engine;
3
4namespace Game {
5 public abstract class LeavesBlock : AlphaTestCubeBlock {
6 public Random m_random = new();
7
8 public abstract Color GetLeavesBlockColor(int value, Terrain terrain, int x, int y, int z);
9
10 public abstract Color GetLeavesItemColor(int value, DrawBlockEnvironmentData environmentData);
11
12 public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) {
13 Color leavesBlockColor = GetLeavesBlockColor(value, generator.Terrain, x, y, z);
14 generator.GenerateCubeVertices(
15 this,
16 value,
17 x,
18 y,
19 z,
20 leavesBlockColor,
22 );
23 }
24
25 public override void DrawBlock(PrimitivesRenderer3D primitivesRenderer,
26 int value,
27 Color color,
28 float size,
29 ref Matrix matrix,
30 DrawBlockEnvironmentData environmentData) {
31 color *= GetLeavesItemColor(value, environmentData);
33 primitivesRenderer,
34 value,
35 new Vector3(size),
36 ref matrix,
37 color,
38 color,
39 environmentData
40 );
41 }
42
44 Vector3 position,
45 int value,
46 float strength) {
47 Color leavesBlockColor = GetLeavesBlockColor(
48 value,
49 subsystemTerrain.Terrain,
50 Terrain.ToCell(position.X),
51 Terrain.ToCell(position.Y),
52 Terrain.ToCell(position.Z)
53 );
55 subsystemTerrain,
56 position,
57 strength,
59 leavesBlockColor,
60 GetFaceTextureSlot(4, value)
61 );
62 }
63 }
64}
Engine.Vector3 Vector3
virtual void GenerateCubeVertices(Block block, int value, int x, int y, int z, Color color, TerrainGeometrySubset[] subsetsByFace)
float DestructionDebrisScale
virtual int GetFaceTextureSlot(int face, int value)
static void DrawCubeBlock(PrimitivesRenderer3D primitivesRenderer, int value, Vector3 size, ref Matrix matrix, Color color, Color topColor, DrawBlockEnvironmentData environmentData)
override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z)
Color GetLeavesItemColor(int value, DrawBlockEnvironmentData environmentData)
override void DrawBlock(PrimitivesRenderer3D primitivesRenderer, int value, Color color, float size, ref Matrix matrix, DrawBlockEnvironmentData environmentData)
Color GetLeavesBlockColor(int value, Terrain terrain, int x, int y, int z)
override BlockDebrisParticleSystem CreateDebrisParticleSystem(SubsystemTerrain subsystemTerrain, Vector3 position, int value, float strength)
TerrainGeometrySubset[] AlphaTestSubsetsByFace
static int ToCell(float x)