9 MeshPass meshPass = (this.hasSubPass &&
SubPassData.Current.enable) ? this.pass.subPass : this.pass;
10 MeshBatch meshBatch = meshPass.batches[meshPass.batchIdx];
11 int num = (p.tile > 0f) ? 1 : -1;
12 if (this.useOffsetBack)
14 this._offset = ((p.dir == 2 || p.dir == 3) ? this.offsetBack : this.offset);
16 if (meshPass == this.pass.subPass)
18 meshBatch.colors[meshPass.idx] = p.color - 1572864f;
23 meshBatch.colors[meshPass.idx] = p.color;
24 meshBatch.matrices[meshPass.idx].m03 = p.x + this._offset.x * (float)num;
25 meshBatch.matrices[meshPass.idx].m13 = p.y + this._offset.y;
26 meshBatch.matrices[meshPass.idx].m23 = p.z + this._offset.z;
28 meshBatch.tiles[meshPass.idx] = p.tile + (float)(p.liquidLv * 10000 * num);
29 meshBatch.matColors[meshPass.idx] = p.matColor;
31 if (meshPass.idx == meshPass.batchSize)
35 if (p.snow &&
this.hasSnowPass && meshPass ==
this.pass)
37 meshPass = this.pass.snowPass;
38 meshBatch = meshPass.batches[meshPass.batchIdx];
39 meshBatch.colors[meshPass.idx] = p.color;
40 meshBatch.matrices[meshPass.idx].m03 = p.x + this._offset.x * (float)num;
41 meshBatch.matrices[meshPass.idx].m13 = p.y + this._offset.y;
42 meshBatch.matrices[meshPass.idx].m23 = p.z + this._offset.z + this.snowZ;
43 meshBatch.tiles[meshPass.idx] = p.tile + (float)(p.liquidLv * 10000 * num);
44 meshBatch.matColors[meshPass.idx] = 104025f;
46 if (meshPass.idx == meshPass.batchSize)
54 private void OnValidate()
56 this._offset = this.offset;