public static BaseConnector FindConnector(Graphic graphic) { if (!graphic) { return(s_EmptyConnector); } var type = graphic.GetType(); BaseConnector 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 = BaseConnector.FindConnector(graphic); newMaterial.shader = connector.FindShader("UIShiny"); paramTex.RegisterMaterial(newMaterial); }
public override void ModifyMaterial(Material newMaterial, Graphic graphic) { var connector = BaseConnector.FindConnector(graphic); newMaterial.shader = connector.FindShader("UIEffect"); 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 = BaseConnector.FindConnector(graphic); newMaterial.shader = connector.FindShader("UIDissolve"); SetShaderVariants(newMaterial, m_ColorMode); newMaterial.SetTexture(k_TransitionTexId, transitionTexture); paramTex.RegisterMaterial(newMaterial); }
protected static void AddConnector(BaseConnector connector) { s_Connectors.Add(connector); s_Connectors.Sort((x, y) => y.priority - x.priority); }