private void OnPostRender() { if (PersistenSingleton <SceneDirector> .Instance.IsFading) { return; } if (this.numRain == 0) { return; } GL.PushMatrix(); this.mat.SetPass(0); GL.Begin(7); for (Int32 i = 0; i < this.numRain; i++) { WorldRainRenderer.Rain rain = this.rainList[i]; Vector3 p = rain.p0; Vector3 p2 = rain.p1; Vector3 p3 = rain.p2; p.x -= this.offset.x; p2.x -= this.offset.x; p3.x -= this.offset.x; p.y -= this.offset.y; p2.y -= this.offset.y; p3.y -= this.offset.y; p.z -= this.offset.z; p2.z -= this.offset.z; p3.z -= this.offset.z; WorldRainRenderer.DrawWorldRain(p, p2, rain.col0, rain.col1); WorldRainRenderer.DrawWorldRain(p2, p3, rain.col1, rain.col0); } GL.End(); GL.PopMatrix(); }
private void _RTPTRain(WorldRainRenderer.Rain p, Int32 rainSpeed, Int32 hold) { Vector3 pos = p.pos; p.p0 = pos; p.p1 = pos; p.p1.y = p.p1.y + (Single)rainSpeed * this.factor; if (hold == 0) { p.pos = p.p1; } p.p2 = p.p1; p.p2.y = p.p2.y + (Single)rainSpeed * this.factor; }
private void _RainLoop() { Camera component = base.gameObject.GetComponent <Camera>(); Vector3 position = component.transform.position; for (Int32 i = 0; i < this.numRain; i++) { WorldRainRenderer.Rain rain = this.rainList[i]; this._RTPTRain(rain, this.speed, this.gen); rain.col0 = new Color(0f, 0f, 0f, 0f); Int32 num = Mathf.FloorToInt((position - rain.pos).magnitude); Int32 num2 = num >> 6; Int32 num3 = 240; num3 -= num2; rain.col1 = new Color((Single)num3 / 255f, (Single)num3 / 255f, (Single)num3 / 255f, 1f); } }