void OnEnable() { if (target == null) { target = transform; } if (glowPasses == null || glowPasses.Length == 0) { glowPasses = new GlowPassData[4]; glowPasses [0] = new GlowPassData() { offset = 4, alpha = 0.1f, color = new Color(0.64f, 1f, 0f, 1f) }; glowPasses [1] = new GlowPassData() { offset = 3, alpha = 0.2f, color = new Color(0.64f, 1f, 0f, 1f) }; glowPasses [2] = new GlowPassData() { offset = 2, alpha = 0.3f, color = new Color(0.64f, 1f, 0f, 1f) }; glowPasses [3] = new GlowPassData() { offset = 1, alpha = 0.4f, color = new Color(0.64f, 1f, 0f, 1f) }; } InitMaterial(ref fxMatMask, "HighlightPlus/Geometry/Mask"); InitMaterial(ref fxMatSeeThrough, "HighlightPlus/Geometry/SeeThrough"); InitMaterial(ref fxMatGlow, "HighlightPlus/Geometry/Glow"); InitMaterial(ref fxMatOutline, "HighlightPlus/Geometry/Outline"); InitMaterial(ref fxMatOverlay, "HighlightPlus/Geometry/Overlay"); SetupMaterial(); }
void OnEnable() { if (offsets == null || offsets.Length < 8) { offsets = new Vector3[] { Vector3.up, Vector3.right, Vector3.down, Vector3.left, new Vector3(-TAU, TAU, 0), new Vector3(TAU, TAU, 0), new Vector3(TAU, -TAU, 0), new Vector3(-TAU, -TAU, 0) }; } if (quadMesh == null) { BuildQuad(); } if (target == null) { target = transform; } if (profileSync && profile != null) { profile.Load(this); } if (glowPasses == null || glowPasses.Length == 0) { glowPasses = new GlowPassData[4]; glowPasses [0] = new GlowPassData() { offset = 4, alpha = 0.1f, color = new Color(0.64f, 1f, 0f, 1f) }; glowPasses [1] = new GlowPassData() { offset = 3, alpha = 0.2f, color = new Color(0.64f, 1f, 0f, 1f) }; glowPasses [2] = new GlowPassData() { offset = 2, alpha = 0.3f, color = new Color(0.64f, 1f, 0f, 1f) }; glowPasses [3] = new GlowPassData() { offset = 1, alpha = 0.4f, color = new Color(0.64f, 1f, 0f, 1f) }; } CheckGeometrySupportDependencies(); SetupMaterial(); }
GlowPassData[] GetGlowPassesCopy(GlowPassData[] glowPasses) { if (glowPasses == null) { return(new GlowPassData[0]); } GlowPassData[] pd = new GlowPassData[glowPasses.Length]; for (int k = 0; k < glowPasses.Length; k++) { pd[k].alpha = glowPasses[k].alpha; pd[k].color = glowPasses[k].color; pd[k].offset = glowPasses[k].offset; } return(pd); }