public override void ToggleCameraComponent(bool flag) { m_glowComp = MyCamera.gameObject.GetComponent <XftGlow> (); if (m_glowComp == null) { m_glowComp = MyCamera.gameObject.AddComponent <XftGlow> (); } m_glowComp.Init(m_owner); m_glowComp.enabled = flag; }
protected void ToggleCameraComponent(bool flag) { m_glowComp = m_camera.gameObject.GetComponent <XftGlow> (); if (m_glowComp == null) { m_glowComp = m_camera.gameObject.AddComponent <XftGlow> (); } //assign the shader here. m_glowComp.Init(m_owner); m_glowComp.enabled = flag; }