public static RedrawCameraGlow GetRedrawCameraGlowScript(Camera pParentCamera, Boolean pCreate) { if (pParentCamera != null) { Transform transform = pParentCamera.transform.FindChild("RedrawCameraGlow"); if (transform != null) { return(transform.GetComponent <RedrawCameraGlow>()); } if (pCreate) { GameObject gameObject = new GameObject("RedrawCameraGlow", new Type[] { typeof(Camera) }); RedrawCameraGlow redrawCameraGlow = gameObject.AddComponent <RedrawCameraGlow>(); redrawCameraGlow.Initialize(pParentCamera, -1); redrawCameraGlow.m_screenComposer = BackgroundGlowFX.GetBackgroundGlowFX(pParentCamera, true); redrawCameraGlow.m_screenComposer.RegistrationData.Camera = redrawCameraGlow; if ((pParentCamera.depthTextureMode & DepthTextureMode.Depth) == DepthTextureMode.None) { pParentCamera.depthTextureMode |= DepthTextureMode.Depth; redrawCameraGlow.m_hasActivatedNormalAndDepth = true; } return(redrawCameraGlow); } } return(null); }
private static void setObjectBackgroundGlow(GameObject pObject, Color pColor, Single pBlendFactorColor, Single pBlendFactorAlpha, Boolean pIsBackgroundGlow, Camera pGlowCamera) { if (pColor.a * pBlendFactorAlpha <= 0f || !pIsBackgroundGlow) { RedrawCameraGlow redrawCameraGlowScript = RedrawCameraGlow.GetRedrawCameraGlowScript(pGlowCamera, false); if (redrawCameraGlowScript != null) { redrawCameraGlowScript.RemoveFromRedrawList(pObject); } } else if (pIsBackgroundGlow) { RedrawCameraGlow redrawCameraGlowScript2 = RedrawCameraGlow.GetRedrawCameraGlowScript(pGlowCamera, true); Color pTintColor = pColor * pBlendFactorColor; pTintColor.a = pColor.a * pBlendFactorAlpha; redrawCameraGlowScript2.AddToRedrawList(pObject, pTintColor); } }
public override void ShowOutline(Boolean doHighlight, Color color) { if (m_isDestroyed) { Debug.LogError("This OutlineGlowFX has been destroyed in this frame you cannot call any functions!"); return; } if (Camera.main != null) { m_outlineColor = color; m_cameraUsedAtShowTime = Camera.main; GlowFXControlScript.SetObjectGlowDeep(gameObject, color, 1f, true, m_cameraUsedAtShowTime); m_Registration = RedrawCameraGlow.GetRedrawCameraGlowScript(m_cameraUsedAtShowTime, false).RegistrationData; m_Registration.DownScale = 2; m_Registration.BlurSpread = BLUR_SPREAD; m_Registration.GlowIntensity = GLOW_INTENSITY; m_isOutlineShown = true; m_transitionTime = ((!doHighlight) ? Time.time : (Time.time + 0.25f)); } }