public override void ModifyMaterial(Material newMaterial, Graphic graphic) { var connector = GraphicConnector.FindConnector(graphic); newMaterial.shader = connector.FindShader("UIShiny"); paramTex.RegisterMaterial(newMaterial); }
public static GraphicConnector FindConnector(Graphic graphic) { if (!graphic) { return(s_EmptyConnector); } var type = graphic.GetType(); GraphicConnector connector = null; if (s_ConnectorMap.TryGetValue(type, out connector)) { return(connector); } foreach (var c in s_Connectors) { if (!c.IsValid(graphic)) { continue; } s_ConnectorMap.Add(type, c); return(c); } return(s_EmptyConnector); }
public override void ModifyMaterial(Material newMaterial, Graphic graphic) { var connector = GraphicConnector.FindConnector(graphic); newMaterial.shader = Shader.Find(string.Format("Hidden/{0} (UIShiny)", newMaterial.shader.name)); paramTex.RegisterMaterial(newMaterial); }
public override void ModifyMaterial(Material newMaterial, Graphic graphic) { var connector = GraphicConnector.FindConnector(graphic); newMaterial.shader = Shader.Find(string.Format("Hidden/{0} (UIEffect)", newMaterial.shader.name)); SetShaderVariants(newMaterial, m_EffectMode, m_ColorMode, m_BlurMode, m_AdvancedBlur ? BlurEx.Ex : BlurEx.None); paramTex.RegisterMaterial(newMaterial); }
public override void ModifyMaterial(Material newMaterial, Graphic graphic) { var connector = GraphicConnector.FindConnector(graphic); newMaterial.shader = connector.FindShader("UIDissolve"); SetShaderVariants(newMaterial, m_ColorMode); newMaterial.SetTexture(k_TransitionTexId, transitionTexture); paramTex.RegisterMaterial(newMaterial); }
public override void ModifyMaterial(Material newMaterial, Graphic graphic) { var connector = GraphicConnector.FindConnector(graphic); newMaterial.shader = Shader.Find(string.Format("Hidden/{0} (UIDissolve)", newMaterial.shader.name)); SetShaderVariants(newMaterial, m_ColorMode); newMaterial.SetTexture(k_TransitionTexId, transitionTexture); paramTex.RegisterMaterial(newMaterial); }
public override void ModifyMaterial(Material newMaterial, Graphic graphic) { var connector = GraphicConnector.FindConnector(graphic); newMaterial.shader = connector.FindShader("UIEffect"); SetShaderVariants(newMaterial, m_EffectMode, m_ColorMode, m_BlurMode, m_AdvancedBlur ? BlurEx.Ex : BlurEx.None); paramTex.RegisterMaterial(newMaterial); }
protected static void AddConnector(GraphicConnector connector) { s_Connectors.Add(connector); s_Connectors.Sort((x, y) => y.priority - x.priority); }