Exemple #1
0
    // Token: 0x06004DC2 RID: 19906 RVA: 0x00135684 File Offset: 0x00133884
    public override void OnFill(NGUI.Meshing.MeshBuffer m)
    {
        if (this.mFont == null)
        {
            return;
        }
        Color normalColor = (!this.mInvisibleHack) ? base.color : Color.clear;

        this.MakePositionPerfect();
        global::UIWidget.Pivot pivot = base.pivot;
        int vSize = m.vSize;

        if (pivot == global::UIWidget.Pivot.Left || pivot == global::UIWidget.Pivot.TopLeft || pivot == global::UIWidget.Pivot.BottomLeft)
        {
            if (this.mOverflowRight)
            {
                this.mFont.Print(this.processedText, normalColor, m, this.mEncoding, this.mSymbols, global::UIFont.Alignment.LeftOverflowRight, Mathf.RoundToInt(this.relativeSize.x * (float)this.mFont.size), ref this.mSelection, this.mCarratChar, this.mHighlightTextColor, this.mHighlightColor, this.mHighlightChar, this.mHighlightCharSplit);
            }
            else
            {
                this.mFont.Print(this.processedText, normalColor, m, this.mEncoding, this.mSymbols, global::UIFont.Alignment.Left, 0, ref this.mSelection, this.mCarratChar, this.mHighlightTextColor, this.mHighlightColor, this.mHighlightChar, this.mHighlightCharSplit);
            }
        }
        else if (pivot == global::UIWidget.Pivot.Right || pivot == global::UIWidget.Pivot.TopRight || pivot == global::UIWidget.Pivot.BottomRight)
        {
            this.mFont.Print(this.processedText, normalColor, m, this.mEncoding, this.mSymbols, global::UIFont.Alignment.Right, Mathf.RoundToInt(this.relativeSize.x * (float)this.mFont.size), ref this.mSelection, this.mCarratChar, this.mHighlightTextColor, this.mHighlightColor, this.mHighlightChar, this.mHighlightCharSplit);
        }
        else
        {
            this.mFont.Print(this.processedText, normalColor, m, this.mEncoding, this.mSymbols, global::UIFont.Alignment.Center, Mathf.RoundToInt(this.relativeSize.x * (float)this.mFont.size), ref this.mSelection, this.mCarratChar, this.mHighlightTextColor, this.mHighlightColor, this.mHighlightChar, this.mHighlightCharSplit);
        }
        m.ApplyEffect(base.cachedTransform, vSize, this.effectStyle, this.effectColor, (float)this.mFont.size);
    }
Exemple #2
0
        public void Copy(ref int start, Vertex[] v, int end, MeshBuffer p)
        {
            int num;
            int num1 = (end - start) / Primitive.VertexCount(this.kind);

Label0:
            int num2 = num1;

            num1 = num2 - 1;
            if (num2 <= 0)
            {
                return;
            }
            int num3 = p.Alloc(this.kind, out num);

            while (num3 < num)
            {
                int num4 = num3;
                num3 = num4 + 1;
                int num5 = start;
                int num6 = num5;
                start     = num5 + 1;
                p.v[num4] = v[num6];
            }
            goto Label0;
        }
    // Token: 0x06004D68 RID: 19816 RVA: 0x00133DB0 File Offset: 0x00131FB0
    public override void OnFill(NGUI.Meshing.MeshBuffer m)
    {
        if (this.mOuterUV == this.mInnerUV)
        {
            base.OnFill(m);
            return;
        }
        NGUI.Structures.float3 @float = default(NGUI.Structures.float3);
        @float.xyz = base.cachedTransform.localScale;
        Vector4 vector;

        vector.x = this.mOuterUV.xMin;
        vector.y = this.mInnerUV.xMin;
        vector.z = this.mInnerUV.xMax;
        vector.w = this.mOuterUV.xMax;
        Vector4 vector2;

        vector2.x = this.mOuterUV.yMin;
        vector2.y = this.mInnerUV.yMin;
        vector2.z = this.mInnerUV.yMax;
        vector2.w = this.mOuterUV.yMax;
        NGUI.Structures.NineRectangle nineRectangle;
        NGUI.Structures.NineRectangle nineRectangle2;
        NGUI.Structures.NineRectangle.Calculate(base.pivot, base.atlas.pixelSize, base.mainTexture, ref vector, ref vector2, ref @float.xy, out nineRectangle, out nineRectangle2);
        Color color = base.color;

        if (this.mFillCenter)
        {
            NGUI.Structures.NineRectangle.Fill9(ref nineRectangle, ref nineRectangle2, ref color, m);
        }
        else
        {
            NGUI.Structures.NineRectangle.Fill8(ref nineRectangle, ref nineRectangle2, ref color, m);
        }
    }
Exemple #4
0
 public override void OnFill(NGUI.Meshing.MeshBuffer m)
 {
     if (base.mOuterUV == this.mInnerUV)
     {
         base.OnFill(m);
     }
     else
     {
         NineRectangle rectangle;
         NineRectangle rectangle2;
         Vector4       vector;
         Vector4       vector2;
         float3        num = new float3 {
             xyz = base.cachedTransform.localScale
         };
         vector.x  = this.mOuterUV.xMin;
         vector.y  = this.mInnerUV.xMin;
         vector.z  = this.mInnerUV.xMax;
         vector.w  = this.mOuterUV.xMax;
         vector2.x = this.mOuterUV.yMin;
         vector2.y = this.mInnerUV.yMin;
         vector2.z = this.mInnerUV.yMax;
         vector2.w = this.mOuterUV.yMax;
         NineRectangle.Calculate(base.pivot, base.atlas.pixelSize, base.mainTexture, ref vector, ref vector2, ref num.xy, out rectangle, out rectangle2);
         Color color = base.color;
         if (this.mFillCenter)
         {
             NineRectangle.Fill9(ref rectangle, ref rectangle2, ref color, m);
         }
         else
         {
             NineRectangle.Fill8(ref rectangle, ref rectangle2, ref color, m);
         }
     }
 }
Exemple #5
0
        public void Copy(ref int start, Vertex[] v, Vector3[] transformed, int end, MeshBuffer p)
        {
            int num;
            int num1 = (end - start) / Primitive.VertexCount(this.kind);

Label0:
            int num2 = num1;

            num1 = num2 - 1;
            if (num2 <= 0)
            {
                return;
            }
            int num3 = p.Alloc(this.kind, out num);

            while (num3 < num)
            {
                p.v[num3].x = transformed[start].x;
                p.v[num3].y = transformed[start].y;
                p.v[num3].z = transformed[start].z;
                p.v[num3].u = v[start].u;
                p.v[num3].v = v[start].v;
                p.v[num3].r = v[start].r;
                p.v[num3].g = v[start].g;
                p.v[num3].b = v[start].b;
                p.v[num3].a = v[start].a;
                num3++;
                start = start + 1;
            }
            goto Label0;
        }
Exemple #6
0
        public int Alloc(PrimitiveKind kind, out int end)
        {
            int num = Primitive.VertexCount(kind);

            if (this.lastPrimitiveKind != kind)
            {
                int num1 = MeshBuffer.Gen_Alloc <Primitive>(1, ref this.primSize, ref this.primCapacity, ref this.primitives, 4, 32, 32);
                if (!Primitive.JoinsInList(kind))
                {
                    this.lastPrimitiveKind = PrimitiveKind.Invalid;
                }
                else
                {
                    this.lastPrimitiveKind = kind;
                }
                this.primitives[num1] = new Primitive(kind, (ushort)this.vSize);
            }
            MeshBuffer meshBuffer = this;

            meshBuffer.iCount = meshBuffer.iCount + Primitive.IndexCount(kind);
            int num2 = MeshBuffer.Gen_Alloc <Vertex>(num, ref this.vSize, ref this.vertCapacity, ref this.v, 32, 512, 512);

            end = num2 + num;
            return(num2);
        }
Exemple #7
0
 // Token: 0x06004B4E RID: 19278 RVA: 0x00125FC0 File Offset: 0x001241C0
 public void WriteBuffers(MeshBuffer target)
 {
     if (this.primSize > 0)
     {
         int num = 0;
         int i;
         for (i = 0; i < this.primSize - 1; i++)
         {
             this.primitives[i].Copy(ref num, this.v, (int)this.primitives[i + 1].start, target);
         }
         this.primitives[i].Copy(ref num, this.v, this.vSize, target);
     }
 }
Exemple #8
0
 public void WriteBuffers(MeshBuffer target)
 {
     if (this.primSize > 0)
     {
         int start = 0;
         int index = 0;
         while (index < (this.primSize - 1))
         {
             this.primitives[index].Copy(ref start, this.v, this.primitives[index + 1].start, target);
             index++;
         }
         this.primitives[index].Copy(ref start, this.v, this.vSize, target);
     }
 }
        // Token: 0x06004B24 RID: 19236 RVA: 0x00122C54 File Offset: 0x00120E54
        public void Copy(ref int start, Vertex[] v, int end, MeshBuffer p)
        {
            int num = (end - start) / Primitive.VertexCount(this.kind);

            while (num-- > 0)
            {
                int num2;
                int i = p.Alloc(this.kind, out num2);
                while (i < num2)
                {
                    p.v[i++] = v[start++];
                }
            }
        }
Exemple #10
0
 // Token: 0x06004B4D RID: 19277 RVA: 0x00125F28 File Offset: 0x00124128
 public void WriteBuffers(Vector3[] transformedVertexes, MeshBuffer target)
 {
     if (transformedVertexes == null)
     {
         this.WriteBuffers(target);
     }
     else if (this.primSize > 0)
     {
         int num = 0;
         int i;
         for (i = 0; i < this.primSize - 1; i++)
         {
             this.primitives[i].Copy(ref num, this.v, transformedVertexes, (int)this.primitives[i + 1].start, target);
         }
         this.primitives[i].Copy(ref num, this.v, transformedVertexes, this.vSize, target);
     }
 }
Exemple #11
0
 public void WriteBuffers(Vector3[] transformedVertexes, MeshBuffer target)
 {
     if (transformedVertexes == null)
     {
         this.WriteBuffers(target);
     }
     else if (this.primSize > 0)
     {
         int start = 0;
         int index = 0;
         while (index < (this.primSize - 1))
         {
             this.primitives[index].Copy(ref start, this.v, transformedVertexes, this.primitives[index + 1].start, target);
             index++;
         }
         this.primitives[index].Copy(ref start, this.v, transformedVertexes, this.vSize, target);
     }
 }
Exemple #12
0
        // Token: 0x06004B40 RID: 19264 RVA: 0x001247E4 File Offset: 0x001229E4
        public bool ExtractMeshBuffers(ref Vector3[] vertices, ref Vector2[] uvs, ref Color[] colors, ref int[] triangles)
        {
            bool result = MeshBuffer.ResizeChecked <Vector3>(ref vertices, this.vSize) | MeshBuffer.ResizeChecked <Vector2>(ref uvs, this.vSize) | MeshBuffer.ResizeChecked <Color>(ref colors, this.vSize) | MeshBuffer.ResizeChecked <int>(ref triangles, this.iCount);

            this.Extract(new MeshBuffer.FillBuffer <Vector3>
            {
                buf = vertices
            }, new MeshBuffer.FillBuffer <Vector2>
            {
                buf = uvs
            }, new MeshBuffer.FillBuffer <Color>
            {
                buf = colors
            }, new MeshBuffer.FillBuffer <int>
            {
                buf = triangles
            });
            return(result);
        }
Exemple #13
0
 // Token: 0x06004AC0 RID: 19136 RVA: 0x0012147C File Offset: 0x0011F67C
 public void Set(NGUI.Meshing.MeshBuffer m)
 {
     if (this.mFilter == null)
     {
         this.mFilter = base.gameObject.GetComponent <MeshFilter>();
     }
     if (this.mFilter == null)
     {
         this.mFilter = base.gameObject.AddComponent <MeshFilter>();
     }
     if (this.mRen == null)
     {
         this.mRen = base.gameObject.GetComponent <MeshRenderer>();
     }
     if (this.mRen == null)
     {
         this.mRen = base.gameObject.AddComponent <MeshRenderer>();
         this.UpdateMaterials();
     }
     if (m.vSize < 65000)
     {
         bool flag = m.ExtractMeshBuffers(ref this.mVerts, ref this.mUVs, ref this.mColors, ref this.mIndices);
         Mesh mesh = this.GetMesh(ref flag, m.vSize);
         mesh.vertices  = this.mVerts;
         mesh.uv        = this.mUVs;
         mesh.colors    = this.mColors;
         mesh.triangles = this.mIndices;
         mesh.RecalculateBounds();
         this.mFilter.mesh = mesh;
     }
     else
     {
         if (this.mFilter.mesh != null)
         {
             this.mFilter.mesh.Clear();
         }
         Debug.LogError("Too many vertices on one panel: " + m.vSize);
     }
 }
Exemple #14
0
        public bool ExtractMeshBuffers(ref Vector3[] vertices, ref Vector2[] uvs, ref Color[] colors, ref int[] triangles)
        {
            bool flag = MeshBuffer.ResizeChecked <Vector3>(ref vertices, this.vSize) | MeshBuffer.ResizeChecked <Vector2>(ref uvs, this.vSize) | MeshBuffer.ResizeChecked <Color>(ref colors, this.vSize) | MeshBuffer.ResizeChecked <int>(ref triangles, this.iCount);

            MeshBuffer.FillBuffer <Vector3> fillBuffer = new MeshBuffer.FillBuffer <Vector3>()
            {
                buf = vertices
            };
            MeshBuffer.FillBuffer <Vector2> fillBuffer1 = new MeshBuffer.FillBuffer <Vector2>()
            {
                buf = uvs
            };
            MeshBuffer.FillBuffer <Color> fillBuffer2 = new MeshBuffer.FillBuffer <Color>()
            {
                buf = colors
            };
            MeshBuffer.FillBuffer <int> fillBuffer3 = new MeshBuffer.FillBuffer <int>()
            {
                buf = triangles
            };
            this.Extract(fillBuffer, fillBuffer1, fillBuffer2, fillBuffer3);
            return(flag);
        }
        // Token: 0x06004B25 RID: 19237 RVA: 0x00122CC8 File Offset: 0x00120EC8
        public void Copy(ref int start, Vertex[] v, Vector3[] transformed, int end, MeshBuffer p)
        {
            int num = (end - start) / Primitive.VertexCount(this.kind);

            while (num-- > 0)
            {
                int num2;
                int i = p.Alloc(this.kind, out num2);
                while (i < num2)
                {
                    p.v[i].x = transformed[start].x;
                    p.v[i].y = transformed[start].y;
                    p.v[i].z = transformed[start].z;
                    p.v[i].u = v[start].u;
                    p.v[i].v = v[start].v;
                    p.v[i].r = v[start].r;
                    p.v[i].g = v[start].g;
                    p.v[i].b = v[start].b;
                    p.v[i].a = v[start].a;
                    i++;
                    start++;
                }
            }
        }
Exemple #16
0
    public override void OnFill(NGUI.Meshing.MeshBuffer m)
    {
        if (this.mFont != null)
        {
            Color normalColor = !this.mInvisibleHack ? base.color : Color.clear;
            this.MakePositionPerfect();
            UIWidget.Pivot pivot = base.pivot;
            int            vSize = m.vSize;
            switch (pivot)
            {
            case UIWidget.Pivot.Left:
            case UIWidget.Pivot.TopLeft:
            case UIWidget.Pivot.BottomLeft:
                if (this.mOverflowRight)
                {
                    this.mFont.Print(this.processedText, normalColor, m, this.mEncoding, this.mSymbols, UIFont.Alignment.LeftOverflowRight, Mathf.RoundToInt(this.relativeSize.x * this.mFont.size), ref this.mSelection, this.mCarratChar, this.mHighlightTextColor, this.mHighlightColor, this.mHighlightChar, this.mHighlightCharSplit);
                }
                else
                {
                    this.mFont.Print(this.processedText, normalColor, m, this.mEncoding, this.mSymbols, UIFont.Alignment.Left, 0, ref this.mSelection, this.mCarratChar, this.mHighlightTextColor, this.mHighlightColor, this.mHighlightChar, this.mHighlightCharSplit);
                }
                break;

            case UIWidget.Pivot.Right:
            case UIWidget.Pivot.TopRight:
            case UIWidget.Pivot.BottomRight:
                this.mFont.Print(this.processedText, normalColor, m, this.mEncoding, this.mSymbols, UIFont.Alignment.Right, Mathf.RoundToInt(this.relativeSize.x * this.mFont.size), ref this.mSelection, this.mCarratChar, this.mHighlightTextColor, this.mHighlightColor, this.mHighlightChar, this.mHighlightCharSplit);
                break;

            default:
                this.mFont.Print(this.processedText, normalColor, m, this.mEncoding, this.mSymbols, UIFont.Alignment.Center, Mathf.RoundToInt(this.relativeSize.x * this.mFont.size), ref this.mSelection, this.mCarratChar, this.mHighlightTextColor, this.mHighlightColor, this.mHighlightChar, this.mHighlightCharSplit);
                break;
            }
            m.ApplyEffect(base.cachedTransform, vSize, this.effectStyle, this.effectColor, (float)this.mFont.size);
        }
    }
Exemple #17
0
        public void ApplyEffect(Transform transform, int vertexStart, int vertexEnd, UILabel.Effect effect, Color effectColor, float size)
        {
            int num;

            if (effect != UILabel.Effect.None && vertexStart != vertexEnd && !NGUITools.ZeroAlpha(effectColor.a) && size != 0f && !MeshBuffer.ZeroedXYScale(transform) && this.SeekPrimitiveIndex(vertexStart, out num))
            {
                float          single  = 1f / size;
                UILabel.Effect effect1 = effect;
                if (effect1 == UILabel.Effect.Shadow)
                {
                    this.ApplyShadow(vertexStart, vertexEnd, num, single, effectColor.r, effectColor.g, effectColor.b, effectColor.a);
                }
                else if (effect1 == UILabel.Effect.Outline)
                {
                    this.ApplyOutline(vertexStart, vertexEnd, num, single, effectColor.r, effectColor.g, effectColor.b, effectColor.a);
                }
            }
        }
    // Token: 0x06004CFE RID: 19710 RVA: 0x0012E744 File Offset: 0x0012C944
    public override void OnFill(NGUI.Meshing.MeshBuffer m)
    {
        float num  = 0f;
        float num2 = 0f;
        float num3 = 1f;
        float num4 = -1f;
        float num5 = this.mOuterUV.xMin;
        float num6 = this.mOuterUV.yMin;
        float num7 = this.mOuterUV.xMax;
        float num8 = this.mOuterUV.yMax;

        if (this.mFillDirection == global::UIFilledSprite.FillDirection.Horizontal || this.mFillDirection == global::UIFilledSprite.FillDirection.Vertical)
        {
            float num9  = (num7 - num5) * this.mFillAmount;
            float num10 = (num8 - num6) * this.mFillAmount;
            if (this.fillDirection == global::UIFilledSprite.FillDirection.Horizontal)
            {
                if (this.mInvert)
                {
                    num  = 1f - this.mFillAmount;
                    num5 = num7 - num9;
                }
                else
                {
                    num3 *= this.mFillAmount;
                    num7  = num5 + num9;
                }
            }
            else if (this.fillDirection == global::UIFilledSprite.FillDirection.Vertical)
            {
                if (this.mInvert)
                {
                    num4 *= this.mFillAmount;
                    num6  = num8 - num10;
                }
                else
                {
                    num2 = -(1f - this.mFillAmount);
                    num8 = num6 + num10;
                }
            }
        }
        Vector2[] array  = new Vector2[4];
        Vector2[] array2 = new Vector2[4];
        array[0]  = new Vector2(num3, num2);
        array[1]  = new Vector2(num3, num4);
        array[2]  = new Vector2(num, num4);
        array[3]  = new Vector2(num, num2);
        array2[0] = new Vector2(num7, num8);
        array2[1] = new Vector2(num7, num6);
        array2[2] = new Vector2(num5, num6);
        array2[3] = new Vector2(num5, num8);
        Color color = base.color;

        if (this.fillDirection == global::UIFilledSprite.FillDirection.Radial90)
        {
            if (!this.AdjustRadial(array, array2, this.mFillAmount, this.mInvert))
            {
                return;
            }
        }
        else
        {
            if (this.fillDirection == global::UIFilledSprite.FillDirection.Radial180)
            {
                Vector2[] array3 = new Vector2[4];
                Vector2[] array4 = new Vector2[4];
                for (int i = 0; i < 2; i++)
                {
                    array3[0] = new Vector2(0f, 0f);
                    array3[1] = new Vector2(0f, 1f);
                    array3[2] = new Vector2(1f, 1f);
                    array3[3] = new Vector2(1f, 0f);
                    array4[0] = new Vector2(0f, 0f);
                    array4[1] = new Vector2(0f, 1f);
                    array4[2] = new Vector2(1f, 1f);
                    array4[3] = new Vector2(1f, 0f);
                    if (this.mInvert)
                    {
                        if (i > 0)
                        {
                            this.Rotate(array3, i);
                            this.Rotate(array4, i);
                        }
                    }
                    else if (i < 1)
                    {
                        this.Rotate(array3, 1 - i);
                        this.Rotate(array4, 1 - i);
                    }
                    float num11;
                    float num12;
                    if (i == 1)
                    {
                        num11 = ((!this.mInvert) ? 1f : 0.5f);
                        num12 = ((!this.mInvert) ? 0.5f : 1f);
                    }
                    else
                    {
                        num11 = ((!this.mInvert) ? 0.5f : 1f);
                        num12 = ((!this.mInvert) ? 1f : 0.5f);
                    }
                    array3[1].y = Mathf.Lerp(num11, num12, array3[1].y);
                    array3[2].y = Mathf.Lerp(num11, num12, array3[2].y);
                    array4[1].y = Mathf.Lerp(num11, num12, array4[1].y);
                    array4[2].y = Mathf.Lerp(num11, num12, array4[2].y);
                    float fill = this.mFillAmount * 2f - (float)i;
                    bool  flag = i % 2 == 1;
                    if (this.AdjustRadial(array3, array4, fill, !flag))
                    {
                        if (this.mInvert)
                        {
                            flag = !flag;
                        }
                        if (flag)
                        {
                            int num13 = m.Alloc(NGUI.Meshing.PrimitiveKind.Quad);
                            for (int j = 0; j < 4; j++)
                            {
                                m.v[num13].x = Mathf.Lerp(array[0].x, array[2].x, array3[j].x);
                                m.v[num13].y = Mathf.Lerp(array[0].y, array[2].y, array3[j].y);
                                m.v[num13].z = 0f;
                                m.v[num13].u = Mathf.Lerp(array2[0].x, array2[2].x, array4[j].x);
                                m.v[num13].v = Mathf.Lerp(array2[0].y, array2[2].y, array4[j].y);
                                m.v[num13].r = color.r;
                                m.v[num13].g = color.g;
                                m.v[num13].b = color.b;
                                m.v[num13].a = color.a;
                                num13++;
                            }
                        }
                        else
                        {
                            int num14 = m.Alloc(NGUI.Meshing.PrimitiveKind.Quad);
                            for (int k = 3; k > -1; k--)
                            {
                                m.v[num14].x = Mathf.Lerp(array[0].x, array[2].x, array3[k].x);
                                m.v[num14].y = Mathf.Lerp(array[0].y, array[2].y, array3[k].y);
                                m.v[num14].z = 0f;
                                m.v[num14].u = Mathf.Lerp(array2[0].x, array2[2].x, array4[k].x);
                                m.v[num14].v = Mathf.Lerp(array2[0].y, array2[2].y, array4[k].y);
                                m.v[num14].r = color.r;
                                m.v[num14].g = color.g;
                                m.v[num14].b = color.b;
                                m.v[num14].a = color.a;
                                num14++;
                            }
                        }
                    }
                }
                return;
            }
            if (this.fillDirection == global::UIFilledSprite.FillDirection.Radial360)
            {
                float[] array5 = new float[]
                {
                    0.5f,
                    1f,
                    0f,
                    0.5f,
                    0.5f,
                    1f,
                    0.5f,
                    1f,
                    0f,
                    0.5f,
                    0.5f,
                    1f,
                    0f,
                    0.5f,
                    0f,
                    0.5f
                };
                Vector2[] array6 = new Vector2[4];
                Vector2[] array7 = new Vector2[4];
                for (int l = 0; l < 4; l++)
                {
                    array6[0] = new Vector2(0f, 0f);
                    array6[1] = new Vector2(0f, 1f);
                    array6[2] = new Vector2(1f, 1f);
                    array6[3] = new Vector2(1f, 0f);
                    array7[0] = new Vector2(0f, 0f);
                    array7[1] = new Vector2(0f, 1f);
                    array7[2] = new Vector2(1f, 1f);
                    array7[3] = new Vector2(1f, 0f);
                    if (this.mInvert)
                    {
                        if (l > 0)
                        {
                            this.Rotate(array6, l);
                            this.Rotate(array7, l);
                        }
                    }
                    else if (l < 3)
                    {
                        this.Rotate(array6, 3 - l);
                        this.Rotate(array7, 3 - l);
                    }
                    for (int n = 0; n < 4; n++)
                    {
                        int   num15 = (!this.mInvert) ? (l * 4) : ((3 - l) * 4);
                        float num16 = array5[num15];
                        float num17 = array5[num15 + 1];
                        float num18 = array5[num15 + 2];
                        float num19 = array5[num15 + 3];
                        array6[n].x = Mathf.Lerp(num16, num17, array6[n].x);
                        array6[n].y = Mathf.Lerp(num18, num19, array6[n].y);
                        array7[n].x = Mathf.Lerp(num16, num17, array7[n].x);
                        array7[n].y = Mathf.Lerp(num18, num19, array7[n].y);
                    }
                    float fill2 = this.mFillAmount * 4f - (float)l;
                    bool  flag2 = l % 2 == 1;
                    if (this.AdjustRadial(array6, array7, fill2, !flag2))
                    {
                        if (this.mInvert)
                        {
                            flag2 = !flag2;
                        }
                        if (flag2)
                        {
                            int num20 = m.Alloc(NGUI.Meshing.PrimitiveKind.Quad);
                            for (int num21 = 0; num21 < 4; num21++)
                            {
                                m.v[num20].x = Mathf.Lerp(array[0].x, array[2].x, array6[num21].x);
                                m.v[num20].y = Mathf.Lerp(array[0].y, array[2].y, array6[num21].y);
                                m.v[num20].z = 0f;
                                m.v[num20].u = Mathf.Lerp(array2[0].x, array2[2].x, array7[num21].x);
                                m.v[num20].v = Mathf.Lerp(array2[0].y, array2[2].y, array7[num21].y);
                                m.v[num20].r = color.r;
                                m.v[num20].g = color.g;
                                m.v[num20].b = color.b;
                                m.v[num20].a = color.a;
                                num20++;
                            }
                        }
                        else
                        {
                            int num22 = m.Alloc(NGUI.Meshing.PrimitiveKind.Quad);
                            for (int num23 = 3; num23 > -1; num23--)
                            {
                                m.v[num22].x = Mathf.Lerp(array[0].x, array[2].x, array6[num23].x);
                                m.v[num22].y = Mathf.Lerp(array[0].y, array[2].y, array6[num23].y);
                                m.v[num22].z = 0f;
                                m.v[num22].u = Mathf.Lerp(array2[0].x, array2[2].x, array7[num23].x);
                                m.v[num22].v = Mathf.Lerp(array2[0].y, array2[2].y, array7[num23].y);
                                m.v[num22].r = color.r;
                                m.v[num22].g = color.g;
                                m.v[num22].b = color.b;
                                m.v[num22].a = color.a;
                                num22++;
                            }
                        }
                    }
                }
                return;
            }
        }
        NGUI.Meshing.Vertex a;
        a.x = array[0].x;
        a.y = array[0].y;
        a.u = array2[0].x;
        a.v = array2[0].y;
        NGUI.Meshing.Vertex b;
        b.x = array[1].x;
        b.y = array[1].y;
        b.u = array2[1].x;
        b.v = array2[1].y;
        NGUI.Meshing.Vertex c;
        c.x = array[2].x;
        c.y = array[2].y;
        c.u = array2[2].x;
        c.v = array2[2].y;
        NGUI.Meshing.Vertex d;
        d.x = array[3].x;
        d.y = array[3].y;
        d.u = array2[3].x;
        d.v = array2[3].y;
        a.z = (b.z = (c.z = (d.z = 0f)));
        a.r = (b.r = (c.r = (d.r = color.r)));
        a.g = (b.g = (c.g = (d.g = color.g)));
        a.b = (b.b = (c.b = (d.b = color.b)));
        a.a = (b.a = (c.a = (d.a = color.a)));
        m.Quad(a, b, c, d);
    }
    // Token: 0x06004E7F RID: 20095 RVA: 0x001447CC File Offset: 0x001429CC
    public override void OnFill(NGUI.Meshing.MeshBuffer m)
    {
        Texture mainTexture = base.material.mainTexture;

        if (mainTexture == null)
        {
            return;
        }
        Rect rect = this.mInner;

        if (base.atlas.coordinates == global::UIAtlas.Coordinates.TexCoords)
        {
            rect = global::NGUIMath.ConvertToPixels(rect, mainTexture.width, mainTexture.height, true);
        }
        Vector2 vector    = base.cachedTransform.localScale;
        float   pixelSize = base.atlas.pixelSize;
        float   num       = Mathf.Abs(rect.width / vector.x) * pixelSize;
        float   num2      = Mathf.Abs(rect.height / vector.y) * pixelSize;

        if (num < 0.01f || num2 < 0.01f)
        {
            Debug.LogWarning("The tiled sprite (" + global::NGUITools.GetHierarchy(base.gameObject) + ") is too small.\nConsider using a bigger one.");
            num  = 0.01f;
            num2 = 0.01f;
        }
        Vector2 vector2;

        vector2..ctor(rect.xMin / (float)mainTexture.width, rect.yMin / (float)mainTexture.height);
        Vector2 vector3;

        vector3..ctor(rect.xMax / (float)mainTexture.width, rect.yMax / (float)mainTexture.height);
        Vector2 vector4 = vector3;
        float   num3    = 0f;
        Color   color   = base.color;

        NGUI.Meshing.Vertex a;
        NGUI.Meshing.Vertex b;
        NGUI.Meshing.Vertex c;
        NGUI.Meshing.Vertex d;
        a.r = (b.r = (c.r = (d.r = color.r)));
        a.g = (b.g = (c.g = (d.g = color.g)));
        a.b = (b.b = (c.b = (d.b = color.b)));
        a.a = (b.a = (c.a = (d.a = color.a)));
        a.z = (b.z = (c.z = (d.z = 0f)));
        while (num3 < 1f)
        {
            float num4 = 0f;
            vector4.x = vector3.x;
            float num5 = num3 + num2;
            if (num5 > 1f)
            {
                vector4.y = vector2.y + (vector3.y - vector2.y) * (1f - num3) / (num5 - num3);
                num5      = 1f;
            }
            while (num4 < 1f)
            {
                float num6 = num4 + num;
                if (num6 > 1f)
                {
                    vector4.x = vector2.x + (vector3.x - vector2.x) * (1f - num4) / (num6 - num4);
                    num6      = 1f;
                }
                a.x = num6;
                a.y = -num3;
                b.x = num6;
                b.y = -num5;
                c.x = num4;
                c.y = -num5;
                d.x = num4;
                d.y = -num3;
                a.u = vector4.x;
                a.v = 1f - vector2.y;
                b.u = vector4.x;
                b.v = 1f - vector4.y;
                c.u = vector2.x;
                c.v = 1f - vector4.y;
                d.u = vector2.x;
                d.v = 1f - vector2.y;
                m.Quad(a, b, c, d);
                num4 += num;
            }
            num3 += num2;
        }
    }
Exemple #20
0
    public override void OnFill(NGUI.Meshing.MeshBuffer m)
    {
        Texture mainTexture = base.material.mainTexture;

        if (mainTexture != null)
        {
            Vertex vertex;
            Vertex vertex2;
            Vertex vertex3;
            Vertex vertex4;
            Rect   mInner = base.mInner;
            if (base.atlas.coordinates == UIAtlas.Coordinates.TexCoords)
            {
                mInner = NGUIMath.ConvertToPixels(mInner, mainTexture.width, mainTexture.height, true);
            }
            Vector2 localScale = base.cachedTransform.localScale;
            float   pixelSize  = base.atlas.pixelSize;
            float   num2       = Mathf.Abs((float)(mInner.width / localScale.x)) * pixelSize;
            float   num3       = Mathf.Abs((float)(mInner.height / localScale.y)) * pixelSize;
            if ((num2 < 0.01f) || (num3 < 0.01f))
            {
                Debug.LogWarning("The tiled sprite (" + NGUITools.GetHierarchy(base.gameObject) + ") is too small.\nConsider using a bigger one.");
                num2 = 0.01f;
                num3 = 0.01f;
            }
            Vector2 vector2 = new Vector2(mInner.xMin / ((float)mainTexture.width), mInner.yMin / ((float)mainTexture.height));
            Vector2 vector3 = new Vector2(mInner.xMax / ((float)mainTexture.width), mInner.yMax / ((float)mainTexture.height));
            Vector2 vector4 = vector3;
            float   num4    = 0f;
            Color   color   = base.color;
            vertex.r = vertex2.r = vertex3.r = vertex4.r = color.r;
            vertex.g = vertex2.g = vertex3.g = vertex4.g = color.g;
            vertex.b = vertex2.b = vertex3.b = vertex4.b = color.b;
            vertex.a = vertex2.a = vertex3.a = vertex4.a = color.a;
            vertex.z = vertex2.z = vertex3.z = vertex4.z = 0f;
            while (num4 < 1f)
            {
                float num5 = 0f;
                vector4.x = vector3.x;
                float num6 = num4 + num3;
                if (num6 > 1f)
                {
                    vector4.y = vector2.y + (((vector3.y - vector2.y) * (1f - num4)) / (num6 - num4));
                    num6      = 1f;
                }
                while (num5 < 1f)
                {
                    float num7 = num5 + num2;
                    if (num7 > 1f)
                    {
                        vector4.x = vector2.x + (((vector3.x - vector2.x) * (1f - num5)) / (num7 - num5));
                        num7      = 1f;
                    }
                    vertex.x  = num7;
                    vertex.y  = -num4;
                    vertex2.x = num7;
                    vertex2.y = -num6;
                    vertex3.x = num5;
                    vertex3.y = -num6;
                    vertex4.x = num5;
                    vertex4.y = -num4;
                    vertex.u  = vector4.x;
                    vertex.v  = 1f - vector2.y;
                    vertex2.u = vector4.x;
                    vertex2.v = 1f - vector4.y;
                    vertex3.u = vector2.x;
                    vertex3.v = 1f - vector4.y;
                    vertex4.u = vector2.x;
                    vertex4.v = 1f - vector2.y;
                    m.Quad(vertex, vertex2, vertex3, vertex4);
                    num5 += num2;
                }
                num4 += num3;
            }
        }
    }
Exemple #21
0
        // Token: 0x06004B4C RID: 19276 RVA: 0x00125E60 File Offset: 0x00124060
        public void ApplyEffect(Transform transform, int vertexStart, int vertexEnd, global::UILabel.Effect effect, Color effectColor, float size)
        {
            int primitiveIndex;

            if (effect != global::UILabel.Effect.None && vertexStart != vertexEnd && !global::NGUITools.ZeroAlpha(effectColor.a) && size != 0f && !MeshBuffer.ZeroedXYScale(transform) && this.SeekPrimitiveIndex(vertexStart, out primitiveIndex))
            {
                float pixel = 1f / size;
                if (effect != global::UILabel.Effect.Shadow)
                {
                    if (effect == global::UILabel.Effect.Outline)
                    {
                        this.ApplyOutline(vertexStart, vertexEnd, primitiveIndex, pixel, effectColor.r, effectColor.g, effectColor.b, effectColor.a);
                    }
                }
                else
                {
                    this.ApplyShadow(vertexStart, vertexEnd, primitiveIndex, pixel, effectColor.r, effectColor.g, effectColor.b, effectColor.a);
                }
            }
        }
Exemple #22
0
 // Token: 0x06004AF4 RID: 19188 RVA: 0x00121DE8 File Offset: 0x0011FFE8
 public void WriteToBuffers(NGUI.Meshing.MeshBuffer m)
 {
     this.meshBuffer.WriteBuffers(m);
 }
Exemple #23
0
    public override void OnFill(NGUI.Meshing.MeshBuffer m)
    {
        Vertex vertex;
        Vertex vertex2;
        Vertex vertex3;
        Vertex vertex4;
        float  x    = 0f;
        float  y    = 0f;
        float  num3 = 1f;
        float  num4 = -1f;
        float  xMin = this.mOuterUV.xMin;
        float  yMin = this.mOuterUV.yMin;
        float  xMax = this.mOuterUV.xMax;
        float  yMax = this.mOuterUV.yMax;

        if ((this.mFillDirection == FillDirection.Horizontal) || (this.mFillDirection == FillDirection.Vertical))
        {
            float num9  = (xMax - xMin) * this.mFillAmount;
            float num10 = (yMax - yMin) * this.mFillAmount;
            if (this.fillDirection == FillDirection.Horizontal)
            {
                if (this.mInvert)
                {
                    x    = 1f - this.mFillAmount;
                    xMin = xMax - num9;
                }
                else
                {
                    num3 *= this.mFillAmount;
                    xMax  = xMin + num9;
                }
            }
            else if (this.fillDirection == FillDirection.Vertical)
            {
                if (this.mInvert)
                {
                    num4 *= this.mFillAmount;
                    yMin  = yMax - num10;
                }
                else
                {
                    y    = -(1f - this.mFillAmount);
                    yMax = yMin + num10;
                }
            }
        }
        Vector2[] xy = new Vector2[4];
        Vector2[] uv = new Vector2[4];
        xy[0] = new Vector2(num3, y);
        xy[1] = new Vector2(num3, num4);
        xy[2] = new Vector2(x, num4);
        xy[3] = new Vector2(x, y);
        uv[0] = new Vector2(xMax, yMax);
        uv[1] = new Vector2(xMax, yMin);
        uv[2] = new Vector2(xMin, yMin);
        uv[3] = new Vector2(xMin, yMax);
        Color color = base.color;

        if (this.fillDirection == FillDirection.Radial90)
        {
            if (!this.AdjustRadial(xy, uv, this.mFillAmount, this.mInvert))
            {
                return;
            }
        }
        else
        {
            if (this.fillDirection == FillDirection.Radial180)
            {
                Vector2[] v            = new Vector2[4];
                Vector2[] vectorArray4 = new Vector2[4];
                for (int i = 0; i < 2; i++)
                {
                    float num12;
                    float num13;
                    v[0]            = new Vector2(0f, 0f);
                    v[1]            = new Vector2(0f, 1f);
                    v[2]            = new Vector2(1f, 1f);
                    v[3]            = new Vector2(1f, 0f);
                    vectorArray4[0] = new Vector2(0f, 0f);
                    vectorArray4[1] = new Vector2(0f, 1f);
                    vectorArray4[2] = new Vector2(1f, 1f);
                    vectorArray4[3] = new Vector2(1f, 0f);
                    if (this.mInvert)
                    {
                        if (i > 0)
                        {
                            this.Rotate(v, i);
                            this.Rotate(vectorArray4, i);
                        }
                    }
                    else if (i < 1)
                    {
                        this.Rotate(v, 1 - i);
                        this.Rotate(vectorArray4, 1 - i);
                    }
                    if (i == 1)
                    {
                        num12 = !this.mInvert ? 1f : 0.5f;
                        num13 = !this.mInvert ? 0.5f : 1f;
                    }
                    else
                    {
                        num12 = !this.mInvert ? 0.5f : 1f;
                        num13 = !this.mInvert ? 1f : 0.5f;
                    }
                    v[1].y            = Mathf.Lerp(num12, num13, v[1].y);
                    v[2].y            = Mathf.Lerp(num12, num13, v[2].y);
                    vectorArray4[1].y = Mathf.Lerp(num12, num13, vectorArray4[1].y);
                    vectorArray4[2].y = Mathf.Lerp(num12, num13, vectorArray4[2].y);
                    float fill = (this.mFillAmount * 2f) - i;
                    bool  flag = (i % 2) == 1;
                    if (this.AdjustRadial(v, vectorArray4, fill, !flag))
                    {
                        if (this.mInvert)
                        {
                            flag = !flag;
                        }
                        if (flag)
                        {
                            int index = m.Alloc(PrimitiveKind.Quad);
                            for (int j = 0; j < 4; j++)
                            {
                                m.v[index].x = Mathf.Lerp(xy[0].x, xy[2].x, v[j].x);
                                m.v[index].y = Mathf.Lerp(xy[0].y, xy[2].y, v[j].y);
                                m.v[index].z = 0f;
                                m.v[index].u = Mathf.Lerp(uv[0].x, uv[2].x, vectorArray4[j].x);
                                m.v[index].v = Mathf.Lerp(uv[0].y, uv[2].y, vectorArray4[j].y);
                                m.v[index].r = color.r;
                                m.v[index].g = color.g;
                                m.v[index].b = color.b;
                                m.v[index].a = color.a;
                                index++;
                            }
                        }
                        else
                        {
                            int num17 = m.Alloc(PrimitiveKind.Quad);
                            for (int k = 3; k > -1; k--)
                            {
                                m.v[num17].x = Mathf.Lerp(xy[0].x, xy[2].x, v[k].x);
                                m.v[num17].y = Mathf.Lerp(xy[0].y, xy[2].y, v[k].y);
                                m.v[num17].z = 0f;
                                m.v[num17].u = Mathf.Lerp(uv[0].x, uv[2].x, vectorArray4[k].x);
                                m.v[num17].v = Mathf.Lerp(uv[0].y, uv[2].y, vectorArray4[k].y);
                                m.v[num17].r = color.r;
                                m.v[num17].g = color.g;
                                m.v[num17].b = color.b;
                                m.v[num17].a = color.a;
                                num17++;
                            }
                        }
                    }
                }
                return;
            }
            if (this.fillDirection == FillDirection.Radial360)
            {
                float[]   numArray     = new float[] { 0.5f, 1f, 0f, 0.5f, 0.5f, 1f, 0.5f, 1f, 0f, 0.5f, 0.5f, 1f, 0f, 0.5f, 0f, 0.5f };
                Vector2[] vectorArray5 = new Vector2[4];
                Vector2[] vectorArray6 = new Vector2[4];
                for (int n = 0; n < 4; n++)
                {
                    vectorArray5[0] = new Vector2(0f, 0f);
                    vectorArray5[1] = new Vector2(0f, 1f);
                    vectorArray5[2] = new Vector2(1f, 1f);
                    vectorArray5[3] = new Vector2(1f, 0f);
                    vectorArray6[0] = new Vector2(0f, 0f);
                    vectorArray6[1] = new Vector2(0f, 1f);
                    vectorArray6[2] = new Vector2(1f, 1f);
                    vectorArray6[3] = new Vector2(1f, 0f);
                    if (this.mInvert)
                    {
                        if (n > 0)
                        {
                            this.Rotate(vectorArray5, n);
                            this.Rotate(vectorArray6, n);
                        }
                    }
                    else if (n < 3)
                    {
                        this.Rotate(vectorArray5, 3 - n);
                        this.Rotate(vectorArray6, 3 - n);
                    }
                    for (int num20 = 0; num20 < 4; num20++)
                    {
                        int   num21 = !this.mInvert ? (n * 4) : ((3 - n) * 4);
                        float from  = numArray[num21];
                        float to    = numArray[num21 + 1];
                        float num24 = numArray[num21 + 2];
                        float num25 = numArray[num21 + 3];
                        vectorArray5[num20].x = Mathf.Lerp(from, to, vectorArray5[num20].x);
                        vectorArray5[num20].y = Mathf.Lerp(num24, num25, vectorArray5[num20].y);
                        vectorArray6[num20].x = Mathf.Lerp(from, to, vectorArray6[num20].x);
                        vectorArray6[num20].y = Mathf.Lerp(num24, num25, vectorArray6[num20].y);
                    }
                    float num26 = (this.mFillAmount * 4f) - n;
                    bool  flag2 = (n % 2) == 1;
                    if (this.AdjustRadial(vectorArray5, vectorArray6, num26, !flag2))
                    {
                        if (this.mInvert)
                        {
                            flag2 = !flag2;
                        }
                        if (flag2)
                        {
                            int num27 = m.Alloc(PrimitiveKind.Quad);
                            for (int num28 = 0; num28 < 4; num28++)
                            {
                                m.v[num27].x = Mathf.Lerp(xy[0].x, xy[2].x, vectorArray5[num28].x);
                                m.v[num27].y = Mathf.Lerp(xy[0].y, xy[2].y, vectorArray5[num28].y);
                                m.v[num27].z = 0f;
                                m.v[num27].u = Mathf.Lerp(uv[0].x, uv[2].x, vectorArray6[num28].x);
                                m.v[num27].v = Mathf.Lerp(uv[0].y, uv[2].y, vectorArray6[num28].y);
                                m.v[num27].r = color.r;
                                m.v[num27].g = color.g;
                                m.v[num27].b = color.b;
                                m.v[num27].a = color.a;
                                num27++;
                            }
                        }
                        else
                        {
                            int num29 = m.Alloc(PrimitiveKind.Quad);
                            for (int num30 = 3; num30 > -1; num30--)
                            {
                                m.v[num29].x = Mathf.Lerp(xy[0].x, xy[2].x, vectorArray5[num30].x);
                                m.v[num29].y = Mathf.Lerp(xy[0].y, xy[2].y, vectorArray5[num30].y);
                                m.v[num29].z = 0f;
                                m.v[num29].u = Mathf.Lerp(uv[0].x, uv[2].x, vectorArray6[num30].x);
                                m.v[num29].v = Mathf.Lerp(uv[0].y, uv[2].y, vectorArray6[num30].y);
                                m.v[num29].r = color.r;
                                m.v[num29].g = color.g;
                                m.v[num29].b = color.b;
                                m.v[num29].a = color.a;
                                num29++;
                            }
                        }
                    }
                }
                return;
            }
        }
        vertex.x  = xy[0].x;
        vertex.y  = xy[0].y;
        vertex.u  = uv[0].x;
        vertex.v  = uv[0].y;
        vertex2.x = xy[1].x;
        vertex2.y = xy[1].y;
        vertex2.u = uv[1].x;
        vertex2.v = uv[1].y;
        vertex3.x = xy[2].x;
        vertex3.y = xy[2].y;
        vertex3.u = uv[2].x;
        vertex3.v = uv[2].y;
        vertex4.x = xy[3].x;
        vertex4.y = xy[3].y;
        vertex4.u = uv[3].x;
        vertex4.v = uv[3].y;
        vertex.z  = vertex2.z = vertex3.z = vertex4.z = 0f;
        vertex.r  = vertex2.r = vertex3.r = vertex4.r = color.r;
        vertex.g  = vertex2.g = vertex3.g = vertex4.g = color.g;
        vertex.b  = vertex2.b = vertex3.b = vertex4.b = color.b;
        vertex.a  = vertex2.a = vertex3.a = vertex4.a = color.a;
        m.Quad(vertex, vertex2, vertex3, vertex4);
    }
Exemple #24
0
    public override void OnFill(NGUI.Meshing.MeshBuffer m)
    {
        Vertex vertex;
        Vertex vertex2;
        Vertex vertex3;
        Vertex vertex4;

        vertex.z  = 0f;
        vertex2.z = 0f;
        vertex3.z = 0f;
        vertex4.z = 0f;
        Color color = base.color;

        vertex.r = vertex2.r = vertex3.r = vertex4.r = color.r;
        vertex.g = vertex2.g = vertex3.g = vertex4.g = color.g;
        vertex.b = vertex2.b = vertex3.b = vertex4.b = color.b;
        vertex.a = vertex2.a = vertex3.a = vertex4.a = color.a;
        if (this._mirrorX)
        {
            if (this._mirrorY)
            {
                vertex.x  = 0.5f;
                vertex.y  = -0.5f;
                vertex2.x = 0.5f;
                vertex2.y = -1f;
                vertex3.x = 0f;
                vertex3.y = -1f;
                vertex4.x = 0f;
                vertex4.y = -0.5f;
                vertex.u  = 1f;
                vertex.v  = 1f;
                vertex2.u = 1f;
                vertex2.v = 0f;
                vertex3.u = 0f;
                vertex3.v = 0f;
                vertex4.u = 0f;
                vertex4.v = 1f;
                m.TextureQuad(vertex, vertex2, vertex3, vertex4);
                vertex.x  = 0.5f;
                vertex.y  = 0f;
                vertex2.x = 0.5f;
                vertex2.y = -0.5f;
                vertex3.x = 0f;
                vertex3.y = -0.5f;
                vertex4.x = 0f;
                vertex4.y = 0f;
                vertex.u  = 0f;
                vertex.v  = 1f;
                vertex2.u = 0f;
                vertex2.v = 0f;
                vertex3.u = 1f;
                vertex3.v = 0f;
                vertex4.u = 1f;
                vertex4.v = 1f;
                m.TextureQuad(vertex, vertex2, vertex3, vertex4);
                vertex.x  = 1f;
                vertex.y  = -0.5f;
                vertex2.x = 1f;
                vertex2.y = -1f;
                vertex3.x = 0.5f;
                vertex3.y = -1f;
                vertex4.x = 0.5f;
                vertex4.y = -0.5f;
                vertex.u  = 1f;
                vertex.v  = 1f;
                vertex2.u = 1f;
                vertex2.v = 0f;
                vertex3.u = 0f;
                vertex3.v = 0f;
                vertex4.u = 0f;
                vertex4.v = 1f;
                m.TextureQuad(vertex, vertex2, vertex3, vertex4);
                vertex.x  = 1f;
                vertex.y  = 0f;
                vertex2.x = 1f;
                vertex2.y = -0.5f;
                vertex3.x = 0.5f;
                vertex3.y = -0.5f;
                vertex4.x = 0.5f;
                vertex4.y = 0f;
                vertex.u  = 0f;
                vertex.v  = 1f;
                vertex2.u = 0f;
                vertex2.v = 0f;
                vertex3.u = 1f;
                vertex3.v = 0f;
                vertex4.u = 1f;
                vertex4.v = 1f;
                m.TextureQuad(vertex, vertex2, vertex3, vertex4);
            }
            else
            {
                vertex.x  = 0.5f;
                vertex.y  = 0f;
                vertex2.x = 0.5f;
                vertex2.y = -1f;
                vertex3.x = 0f;
                vertex3.y = -1f;
                vertex4.x = 0f;
                vertex4.y = 0f;
                vertex.u  = 1f;
                vertex.v  = 1f;
                vertex2.u = 1f;
                vertex2.v = 0f;
                vertex3.u = 0f;
                vertex3.v = 0f;
                vertex4.u = 0f;
                vertex4.v = 1f;
                m.TextureQuad(vertex, vertex2, vertex3, vertex4);
                vertex.x  = 1f;
                vertex.y  = 0f;
                vertex2.x = 1f;
                vertex2.y = -1f;
                vertex3.x = 0.5f;
                vertex3.y = -1f;
                vertex4.x = 0.5f;
                vertex4.y = 0f;
                vertex.u  = 0f;
                vertex.v  = 1f;
                vertex2.u = 0f;
                vertex2.v = 0f;
                vertex3.u = 1f;
                vertex3.v = 0f;
                vertex4.u = 1f;
                vertex4.v = 1f;
                m.TextureQuad(vertex, vertex2, vertex3, vertex4);
            }
        }
        else if (this._mirrorY)
        {
            vertex.x  = 1f;
            vertex.y  = -0.5f;
            vertex2.x = 1f;
            vertex2.y = -1f;
            vertex3.x = 0f;
            vertex3.y = -1f;
            vertex4.x = 0f;
            vertex4.y = -0.5f;
            vertex.u  = 1f;
            vertex.v  = 0f;
            vertex2.u = 1f;
            vertex2.v = 1f;
            vertex3.u = 0f;
            vertex3.v = 1f;
            vertex4.u = 0f;
            vertex4.v = 0f;
            m.TextureQuad(vertex, vertex2, vertex3, vertex4);
            vertex.x  = 1f;
            vertex.y  = 0f;
            vertex2.x = 1f;
            vertex2.y = -0.5f;
            vertex3.x = 0f;
            vertex3.y = -0.5f;
            vertex4.x = 0f;
            vertex4.y = 0f;
            vertex.u  = 1f;
            vertex.v  = 1f;
            vertex2.u = 1f;
            vertex2.v = 0f;
            vertex3.u = 0f;
            vertex3.v = 0f;
            vertex4.u = 0f;
            vertex4.v = 1f;
            m.TextureQuad(vertex, vertex2, vertex3, vertex4);
        }
        else
        {
            vertex.x  = 1f;
            vertex.y  = 0f;
            vertex2.x = 1f;
            vertex2.y = -1f;
            vertex3.x = 0f;
            vertex3.y = -1f;
            vertex4.x = 0f;
            vertex4.y = 0f;
            vertex.u  = 1f;
            vertex.v  = 1f;
            vertex2.u = 1f;
            vertex2.v = 0f;
            vertex3.u = 0f;
            vertex3.v = 0f;
            vertex4.u = 0f;
            vertex4.v = 1f;
            m.TextureQuad(vertex, vertex2, vertex3, vertex4);
        }
    }
Exemple #25
0
    // Token: 0x06004E7A RID: 20090 RVA: 0x00143E24 File Offset: 0x00142024
    public override void OnFill(NGUI.Meshing.MeshBuffer m)
    {
        NGUI.Meshing.Vertex a;
        a.z = 0f;
        NGUI.Meshing.Vertex b;
        b.z = 0f;
        NGUI.Meshing.Vertex c;
        c.z = 0f;
        NGUI.Meshing.Vertex d;
        d.z = 0f;
        Color color = base.color;

        a.r = (b.r = (c.r = (d.r = color.r)));
        a.g = (b.g = (c.g = (d.g = color.g)));
        a.b = (b.b = (c.b = (d.b = color.b)));
        a.a = (b.a = (c.a = (d.a = color.a)));
        if (this._mirrorX)
        {
            if (this._mirrorY)
            {
                a.x = 0.5f;
                a.y = -0.5f;
                b.x = 0.5f;
                b.y = -1f;
                c.x = 0f;
                c.y = -1f;
                d.x = 0f;
                d.y = -0.5f;
                a.u = 1f;
                a.v = 1f;
                b.u = 1f;
                b.v = 0f;
                c.u = 0f;
                c.v = 0f;
                d.u = 0f;
                d.v = 1f;
                m.TextureQuad(a, b, c, d);
                a.x = 0.5f;
                a.y = -0f;
                b.x = 0.5f;
                b.y = -0.5f;
                c.x = 0f;
                c.y = -0.5f;
                d.x = 0f;
                d.y = -0f;
                a.u = 0f;
                a.v = 1f;
                b.u = 0f;
                b.v = 0f;
                c.u = 1f;
                c.v = 0f;
                d.u = 1f;
                d.v = 1f;
                m.TextureQuad(a, b, c, d);
                a.x = 1f;
                a.y = -0.5f;
                b.x = 1f;
                b.y = -1f;
                c.x = 0.5f;
                c.y = -1f;
                d.x = 0.5f;
                d.y = -0.5f;
                a.u = 1f;
                a.v = 1f;
                b.u = 1f;
                b.v = 0f;
                c.u = 0f;
                c.v = 0f;
                d.u = 0f;
                d.v = 1f;
                m.TextureQuad(a, b, c, d);
                a.x = 1f;
                a.y = -0f;
                b.x = 1f;
                b.y = -0.5f;
                c.x = 0.5f;
                c.y = -0.5f;
                d.x = 0.5f;
                d.y = -0f;
                a.u = 0f;
                a.v = 1f;
                b.u = 0f;
                b.v = 0f;
                c.u = 1f;
                c.v = 0f;
                d.u = 1f;
                d.v = 1f;
                m.TextureQuad(a, b, c, d);
            }
            else
            {
                a.x = 0.5f;
                a.y = 0f;
                b.x = 0.5f;
                b.y = -1f;
                c.x = 0f;
                c.y = -1f;
                d.x = 0f;
                d.y = -0f;
                a.u = 1f;
                a.v = 1f;
                b.u = 1f;
                b.v = 0f;
                c.u = 0f;
                c.v = 0f;
                d.u = 0f;
                d.v = 1f;
                m.TextureQuad(a, b, c, d);
                a.x = 1f;
                a.y = 0f;
                b.x = 1f;
                b.y = -1f;
                c.x = 0.5f;
                c.y = -1f;
                d.x = 0.5f;
                d.y = 0f;
                a.u = 0f;
                a.v = 1f;
                b.u = 0f;
                b.v = 0f;
                c.u = 1f;
                c.v = 0f;
                d.u = 1f;
                d.v = 1f;
                m.TextureQuad(a, b, c, d);
            }
        }
        else if (this._mirrorY)
        {
            a.x = 1f;
            a.y = -0.5f;
            b.x = 1f;
            b.y = -1f;
            c.x = 0f;
            c.y = -1f;
            d.x = 0f;
            d.y = -0.5f;
            a.u = 1f;
            a.v = 0f;
            b.u = 1f;
            b.v = 1f;
            c.u = 0f;
            c.v = 1f;
            d.u = 0f;
            d.v = 0f;
            m.TextureQuad(a, b, c, d);
            a.x = 1f;
            a.y = 0f;
            b.x = 1f;
            b.y = -0.5f;
            c.x = 0f;
            c.y = -0.5f;
            d.x = 0f;
            d.y = -0f;
            a.u = 1f;
            a.v = 1f;
            b.u = 1f;
            b.v = 0f;
            c.u = 0f;
            c.v = 0f;
            d.u = 0f;
            d.v = 1f;
            m.TextureQuad(a, b, c, d);
        }
        else
        {
            a.x = 1f;
            a.y = 0f;
            b.x = 1f;
            b.y = -1f;
            c.x = 0f;
            c.y = -1f;
            d.x = 0f;
            d.y = -0f;
            a.u = 1f;
            a.v = 1f;
            b.u = 1f;
            b.v = 0f;
            c.u = 0f;
            c.v = 0f;
            d.u = 0f;
            d.v = 1f;
            m.TextureQuad(a, b, c, d);
        }
    }
Exemple #26
0
 public abstract void OnFill(NGUI.Meshing.MeshBuffer m);
    // Token: 0x06002B1E RID: 11038 RVA: 0x000A0038 File Offset: 0x0009E238
    public override void OnFill(NGUI.Meshing.MeshBuffer m)
    {
        float num       = this._degreesOfRotation * 0.0174532924f;
        float num2      = this._sliceDegrees * 0.0174532924f;
        float sliceFill = this._sliceFill;
        int   num3      = this.slices + 1;
        float num4      = (num - num2 * (float)this.slices) * sliceFill;
        float num5      = num4 / (float)num3;
        float num6      = num4 / 6.28318548f;
        float num7      = (num - num4) / (float)num3;

        NGUI.Structures.float3 @float = default(NGUI.Structures.float3);
        @float.xyz = base.cachedTransform.localScale;
        float num8 = (@float.x >= @float.y) ? @float.x : @float.y;

        @float.xy.x = 3.14159274f * num8 / (float)num3 * num6;
        @float.xy.y = num8 * (this.outerRadius * 0.5f);
        Vector4 vector;

        vector.x = this.mOuterUV.xMin;
        vector.y = this.mInnerUV.xMin;
        vector.z = this.mInnerUV.xMax;
        vector.w = this.mOuterUV.xMax;
        Vector4 vector2;

        vector2.x = this.mOuterUV.yMin;
        vector2.y = this.mInnerUV.yMin;
        vector2.z = this.mInnerUV.yMax;
        vector2.w = this.mOuterUV.yMax;
        NGUI.Structures.NineRectangle nineRectangle;
        NGUI.Structures.NineRectangle nineRectangle2;
        NGUI.Structures.NineRectangle.Calculate(global::UIWidget.Pivot.Center, base.atlas.pixelSize, base.mainTexture, ref vector, ref vector2, ref @float.xy, out nineRectangle, out nineRectangle2);
        if (this.innerRadius > 0f && !Mathf.Approximately(nineRectangle.zz.x - nineRectangle.yy.x, 0f))
        {
            @float.xy.x = 3.14159274f * num8 * this.innerRadius / (float)num3 * num6;
            NGUI.Structures.NineRectangle nineRectangle3;
            NGUI.Structures.NineRectangle nineRectangle4;
            NGUI.Structures.NineRectangle.Calculate(global::UIWidget.Pivot.Center, base.atlas.pixelSize, base.mainTexture, ref vector, ref vector2, ref @float.xy, out nineRectangle3, out nineRectangle4);
            float num9 = (nineRectangle.yy.x + nineRectangle.zz.x) * 0.5f;
            if (nineRectangle3.yy.x > num9)
            {
                float num10 = (nineRectangle3.yy.x - num9) / (nineRectangle.ww.x - num9);
                if (num10 >= 1f)
                {
                    nineRectangle3.xx.x = nineRectangle.xx.x;
                    nineRectangle3.xx.y = nineRectangle.xx.y;
                    nineRectangle3.yy.x = nineRectangle.yy.x;
                    nineRectangle3.yy.y = nineRectangle.yy.y;
                    nineRectangle3.zz.x = nineRectangle.zz.x;
                    nineRectangle3.zz.y = nineRectangle.zz.y;
                    nineRectangle3.ww.x = nineRectangle.ww.x;
                    nineRectangle3.ww.y = nineRectangle.ww.y;
                    nineRectangle4.xx.x = nineRectangle2.xx.x;
                    nineRectangle4.xx.y = nineRectangle2.xx.y;
                    nineRectangle4.yy.x = nineRectangle2.yy.x;
                    nineRectangle4.yy.y = nineRectangle2.yy.y;
                    nineRectangle4.zz.x = nineRectangle2.zz.x;
                    nineRectangle4.zz.y = nineRectangle2.zz.y;
                    nineRectangle4.ww.x = nineRectangle2.ww.x;
                    nineRectangle4.ww.y = nineRectangle2.ww.y;
                }
                else
                {
                    float num11 = 1f - num10;
                    nineRectangle3.xx.y = nineRectangle.xx.y * num10 + nineRectangle3.xx.y * num11;
                    nineRectangle3.yy.x = nineRectangle.yy.x * num10 + 0.5f * num11;
                    nineRectangle3.yy.y = nineRectangle.yy.y * num10 + nineRectangle3.yy.y * num11;
                    nineRectangle3.zz.x = nineRectangle.zz.x * num10 + 0.5f * num11;
                    nineRectangle3.zz.y = nineRectangle.zz.y * num10 + nineRectangle3.zz.y * num11;
                    nineRectangle3.ww.y = nineRectangle.ww.y * num10 + nineRectangle3.ww.y * num11;
                    nineRectangle3.ww.x = nineRectangle.ww.x;
                    nineRectangle3.xx.x = nineRectangle.xx.x;
                }
            }
        }
        else
        {
            NGUI.Structures.NineRectangle nineRectangle3;
            nineRectangle3.xx.x = nineRectangle.xx.x;
            nineRectangle3.xx.y = nineRectangle.xx.y;
            nineRectangle3.yy.x = nineRectangle.yy.x;
            nineRectangle3.yy.y = nineRectangle.yy.y;
            nineRectangle3.zz.x = nineRectangle.zz.x;
            nineRectangle3.zz.y = nineRectangle.zz.y;
            nineRectangle3.ww.x = nineRectangle.ww.x;
            nineRectangle3.ww.y = nineRectangle.ww.y;
            NGUI.Structures.NineRectangle nineRectangle4;
            nineRectangle4.xx.x = nineRectangle2.xx.x;
            nineRectangle4.xx.y = nineRectangle2.xx.y;
            nineRectangle4.yy.x = nineRectangle2.yy.x;
            nineRectangle4.yy.y = nineRectangle2.yy.y;
            nineRectangle4.zz.x = nineRectangle2.zz.x;
            nineRectangle4.zz.y = nineRectangle2.zz.y;
            nineRectangle4.ww.x = nineRectangle2.ww.x;
            nineRectangle4.ww.y = nineRectangle2.ww.y;
        }
        float num12 = Mathf.Abs(nineRectangle.ww.x - nineRectangle.xx.x);
        float num13 = num5 / num12;

        if (num2 > 0f)
        {
            num12 += num2 / num13;
            num13  = num5 / num12;
        }
        float num14 = this.innerRadius * 0.5f;
        float num15 = this.outerRadius * 0.5f;
        float num16 = Mathf.Min(nineRectangle.xx.y, nineRectangle.ww.y);
        float num17 = Mathf.Max(nineRectangle.ww.y, nineRectangle.xx.y) - num16;
        Color color = base.color;
        int   num18 = m.vSize;
        float num19 = num7 + num5;
        float num20 = num7 * -0.5f + (this._facialRotationOffset * 0.5f + 0.5f) * num5 + this._addDegrees * 0.0174532924f;

        for (;;)
        {
            NGUI.Meshing.Vertex[] v = m.v;
            int vSize = m.vSize;
            for (int i = num18; i < vSize; i++)
            {
                float num21 = num14 + (v[i].y - num16) / num17 * num15;
                float num22 = v[i].x * num13 + num20;
                v[i].x = 0.5f + Mathf.Sin(num22) * num21;
                v[i].y = -0.5f + Mathf.Cos(num22) * num21;
            }
            if (--num3 <= 0)
            {
                break;
            }
            num20 += num19;
            num18  = vSize;
        }
    }
Exemple #28
0
 // Token: 0x06004E5D RID: 20061 RVA: 0x00143490 File Offset: 0x00141690
 public override void OnFill(NGUI.Meshing.MeshBuffer m)
 {
     m.FastQuad(this.mOuterUV, base.color);
 }
Exemple #29
0
    public override void OnFill(NGUI.Meshing.MeshBuffer m)
    {
        NineRectangle rectangle;
        NineRectangle rectangle2;
        NineRectangle rectangle3;
        NineRectangle rectangle4;
        Vector4       vector;
        Vector4       vector2;
        float         num  = this._degreesOfRotation * 0.01745329f;
        float         num2 = this._sliceDegrees * 0.01745329f;
        float         num3 = this._sliceFill;
        int           num4 = this.slices + 1;
        float         num5 = (num - (num2 * this.slices)) * num3;
        float         num6 = num5 / ((float)num4);
        float         num7 = num5 / 6.283185f;
        float         num8 = (num - num5) / ((float)num4);
        float3        num9 = new float3 {
            xyz = base.cachedTransform.localScale
        };
        float num10 = (num9.x >= num9.y) ? num9.x : num9.y;

        num9.xy.x = ((3.141593f * num10) / ((float)num4)) * num7;
        num9.xy.y = num10 * (this.outerRadius * 0.5f);
        vector.x  = this.mOuterUV.xMin;
        vector.y  = this.mInnerUV.xMin;
        vector.z  = this.mInnerUV.xMax;
        vector.w  = this.mOuterUV.xMax;
        vector2.x = this.mOuterUV.yMin;
        vector2.y = this.mInnerUV.yMin;
        vector2.z = this.mInnerUV.yMax;
        vector2.w = this.mOuterUV.yMax;
        NineRectangle.Calculate(UIWidget.Pivot.Center, base.atlas.pixelSize, base.mainTexture, ref vector, ref vector2, ref num9.xy, out rectangle, out rectangle3);
        if ((this.innerRadius > 0f) && !Mathf.Approximately(rectangle.zz.x - rectangle.yy.x, 0f))
        {
            num9.xy.x = (((3.141593f * num10) * this.innerRadius) / ((float)num4)) * num7;
            NineRectangle.Calculate(UIWidget.Pivot.Center, base.atlas.pixelSize, base.mainTexture, ref vector, ref vector2, ref num9.xy, out rectangle2, out rectangle4);
            float num11 = (rectangle.yy.x + rectangle.zz.x) * 0.5f;
            if (rectangle2.yy.x > num11)
            {
                float num12 = (rectangle2.yy.x - num11) / (rectangle.ww.x - num11);
                if (num12 >= 1f)
                {
                    rectangle2.xx.x = rectangle.xx.x;
                    rectangle2.xx.y = rectangle.xx.y;
                    rectangle2.yy.x = rectangle.yy.x;
                    rectangle2.yy.y = rectangle.yy.y;
                    rectangle2.zz.x = rectangle.zz.x;
                    rectangle2.zz.y = rectangle.zz.y;
                    rectangle2.ww.x = rectangle.ww.x;
                    rectangle2.ww.y = rectangle.ww.y;
                    rectangle4.xx.x = rectangle3.xx.x;
                    rectangle4.xx.y = rectangle3.xx.y;
                    rectangle4.yy.x = rectangle3.yy.x;
                    rectangle4.yy.y = rectangle3.yy.y;
                    rectangle4.zz.x = rectangle3.zz.x;
                    rectangle4.zz.y = rectangle3.zz.y;
                    rectangle4.ww.x = rectangle3.ww.x;
                    rectangle4.ww.y = rectangle3.ww.y;
                }
                else
                {
                    float num13 = 1f - num12;
                    rectangle2.xx.y = (rectangle.xx.y * num12) + (rectangle2.xx.y * num13);
                    rectangle2.yy.x = (rectangle.yy.x * num12) + (0.5f * num13);
                    rectangle2.yy.y = (rectangle.yy.y * num12) + (rectangle2.yy.y * num13);
                    rectangle2.zz.x = (rectangle.zz.x * num12) + (0.5f * num13);
                    rectangle2.zz.y = (rectangle.zz.y * num12) + (rectangle2.zz.y * num13);
                    rectangle2.ww.y = (rectangle.ww.y * num12) + (rectangle2.ww.y * num13);
                    rectangle2.ww.x = rectangle.ww.x;
                    rectangle2.xx.x = rectangle.xx.x;
                }
            }
        }
        else
        {
            rectangle2.xx.x = rectangle.xx.x;
            rectangle2.xx.y = rectangle.xx.y;
            rectangle2.yy.x = rectangle.yy.x;
            rectangle2.yy.y = rectangle.yy.y;
            rectangle2.zz.x = rectangle.zz.x;
            rectangle2.zz.y = rectangle.zz.y;
            rectangle2.ww.x = rectangle.ww.x;
            rectangle2.ww.y = rectangle.ww.y;
            rectangle4.xx.x = rectangle3.xx.x;
            rectangle4.xx.y = rectangle3.xx.y;
            rectangle4.yy.x = rectangle3.yy.x;
            rectangle4.yy.y = rectangle3.yy.y;
            rectangle4.zz.x = rectangle3.zz.x;
            rectangle4.zz.y = rectangle3.zz.y;
            rectangle4.ww.x = rectangle3.ww.x;
            rectangle4.ww.y = rectangle3.ww.y;
        }
        float num14 = Mathf.Abs((float)(rectangle.ww.x - rectangle.xx.x));
        float num15 = num6 / num14;

        if (num2 > 0f)
        {
            num14 += num2 / num15;
            num15  = num6 / num14;
        }
        float num16 = this.innerRadius * 0.5f;
        float num17 = this.outerRadius * 0.5f;
        float num18 = Mathf.Min(rectangle.xx.y, rectangle.ww.y);
        float num19 = Mathf.Max(rectangle.ww.y, rectangle.xx.y) - num18;
        Color color = base.color;
        int   vSize = m.vSize;
        float num21 = num8 + num6;
        float num22 = ((num8 * -0.5f) + (((this._facialRotationOffset * 0.5f) + 0.5f) * num6)) + (this._addDegrees * 0.01745329f);

        while (true)
        {
            Vertex[] v     = m.v;
            int      num23 = m.vSize;
            for (int i = vSize; i < num23; i++)
            {
                float num25 = num16 + (((v[i].y - num18) / num19) * num17);
                float f     = (v[i].x * num15) + num22;
                v[i].x = 0.5f + (Mathf.Sin(f) * num25);
                v[i].y = -0.5f + (Mathf.Cos(f) * num25);
            }
            if (--num4 <= 0)
            {
                return;
            }
            num22 += num21;
            vSize  = num23;
        }
    }