Exemplo n.º 1
0
        /// <summary>
        /// 绘制Shadow
        /// </summary>
        /// <param name="vh"></param>
        private void ModifyMesh(VertexHelper vh)
        {
            if (!IsActive())
            {
                return;
            }

            var output = UIEffectListPool <UIVertex> .Get();

            vh.GetUIVertexStream(output);

            int len = output.Count;

            var neededCpacity = output.Count * 6;

            if (output.Capacity < neededCpacity)
            {
                output.Capacity = neededCpacity;
            }

//			Shadow

            ApplyShadowZeroAlloc(output, m_ShadowEffectColor, 0, output.Count, m_ShadowEffectDistance.x,
                                 m_ShadowEffectDistance.y, m_ShadowUseGraphicAlpha);

//			Outline

            var start = len;
            var end   = output.Count;

            ApplyShadowZeroAlloc(output, m_OutlineEffectColor, start, output.Count, m_OutlineEffectDistance.x,
                                 m_OutlineEffectDistance.y, m_OutlineUseGraphicAlpha);

            start = end;
            end   = output.Count;
            ApplyShadowZeroAlloc(output, m_OutlineEffectColor, start, output.Count, m_OutlineEffectDistance.x,
                                 -m_OutlineEffectDistance.y, m_OutlineUseGraphicAlpha);

            start = end;
            end   = output.Count;
            ApplyShadowZeroAlloc(output, m_OutlineEffectColor, start, output.Count, -m_OutlineEffectDistance.x,
                                 m_OutlineEffectDistance.y, m_OutlineUseGraphicAlpha);

            start = end;
            end   = output.Count;
            ApplyShadowZeroAlloc(output, m_OutlineEffectColor, start, output.Count, -m_OutlineEffectDistance.x,
                                 -m_OutlineEffectDistance.y, m_OutlineUseGraphicAlpha);

            vh.Clear();
            vh.AddUIVertexTriangleStream(output);
            UIEffectListPool <UIVertex> .Release(output);
        }
Exemplo n.º 2
0
        public override void ModifyMesh(VertexHelper vh)
        {
            if (IsActive() == false)
            {
                return;
            }

            var vList = UIEffectListPool <UIVertex> .Get();

            vh.GetUIVertexStream(vList);

            ModifyVertices(vList);

            vh.Clear();
            vh.AddUIVertexTriangleStream(vList);

            UIEffectListPool <UIVertex> .Release(vList);
        }