Example #1
0
        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);
        }
Example #2
0
 public static void SetVerticesDirtyEx(this Graphic graphic)
 {
     GraphicConnector.FindConnector(graphic).SetVerticesDirty(graphic);
 }
Example #3
0
 protected static void AddConnector(GraphicConnector connector)
 {
     s_Connectors.Add(connector);
     s_Connectors.Sort((x, y) => y.priority - x.priority);
 }
Example #4
0
 public static void SetMaterialDirtyEx(this Graphic graphic)
 {
     GraphicConnector.FindConnector(graphic).SetMaterialDirty(graphic);
 }