void RemoveShadowTrigger() { if (GlobalProjectorManager.Exists()) { GlobalProjectorManager.Get().RemoveShadowTrigger(this); } }
// Token: 0x060001DF RID: 479 RVA: 0x0001AFF0 File Offset: 0x000191F0 private void OnDestroy() { if (GlobalProjectorManager.Exists()) { GlobalProjectorManager.Get().RemoveProjector(this); } }
void AddShadowTrigger() { if (GlobalProjectorManager.Exists()) { GlobalProjectorManager.Get().AddShadowTrigger(this); } }
// Token: 0x060001F6 RID: 502 RVA: 0x0001B5D0 File Offset: 0x000197D0 private void RemoveReceiver() { if (GlobalProjectorManager.Exists() && this._meshFilter != null) { GlobalProjectorManager.Get().RemoveReceiver(this); } }
public static Mesh CreatePlane(Vector3 up, Vector3 right, Rect uvRect, Color color, ShadowProjector parent) { Mesh planeMesh = new Mesh(); bool shouldFlipX = (GlobalProjectorManager.Exists() ? GlobalProjectorManager.GlobalFlipX : parent.GlobalFlipX); Vector2 flipX = new Vector2(uvRect.width, -uvRect.width); bool shouldFlipY = (GlobalProjectorManager.Exists() ? GlobalProjectorManager.GlobalFlipY : parent.GlobalFlipY); Vector2 flipY = new Vector2(-uvRect.height, uvRect.height); Vector3[] vertices = new Vector3[] { (up * 0.5f - right * 0.5f), (up * 0.5f + right * 0.5f), (-up * 0.5f - right * 0.5f), (-up * 0.5f + right * 0.5f) }; Vector2[] uvs = new Vector2[] { new Vector2(uvRect.x, uvRect.y + uvRect.height), new Vector2(uvRect.x + uvRect.width, uvRect.y + uvRect.height), new Vector2(uvRect.x, uvRect.y), new Vector2(uvRect.x + uvRect.width, uvRect.y), }; Color[] colors = new Color[] { color, color, color, color }; int[] indices = new int[] { 0, 1, 3, 0, 3, 2 }; if (shouldFlipX) { uvs[0].x += flipX[0]; uvs[1].x += flipX[1]; uvs[2].x += flipX[0]; uvs[3].x += flipX[1]; } if (shouldFlipY) { uvs[0].y += flipY[0]; uvs[1].y += flipY[0]; uvs[2].y += flipY[1]; uvs[3].y += flipY[1]; } planeMesh.vertices = vertices; planeMesh.uv = uvs; planeMesh.colors = colors; planeMesh.SetTriangles(indices, 0); return(planeMesh); }
void OnDisable() { if (GlobalProjectorManager.Exists()) { GlobalProjectorManager.Get().RemoveProjector(this); if (_ShadowDummy != null) { _Renderer.enabled = false; } } }
void RemoveReceiver() { if (GlobalProjectorManager.Exists()) { if (_meshFilter != null || _terrain != null) { if (IsTerrain()) { _terrain.enabled = false; } GlobalProjectorManager.Get().RemoveReceiver(this); } } }