示例#1
0
        public unsafe bool Load()
        {
            //IL_0060: Unknown result type (might be due to invalid IL or missing references)
            //IL_0065: Unknown result type (might be due to invalid IL or missing references)
            //IL_0068: Unknown result type (might be due to invalid IL or missing references)
            //IL_0076: Unknown result type (might be due to invalid IL or missing references)
            //IL_0090: Unknown result type (might be due to invalid IL or missing references)
            //IL_0097: Unknown result type (might be due to invalid IL or missing references)
            //IL_0135: Unknown result type (might be due to invalid IL or missing references)
            //IL_013a: Unknown result type (might be due to invalid IL or missing references)
            if (null == m_sprite)
            {
                return(false);
            }
            float num  = 0f;
            float num2 = 0f;

            Vector2[] vertices  = m_sprite.get_vertices();
            ushort[]  triangles = m_sprite.get_triangles();
            int       num3      = vertices.Length;
            int       num4      = triangles.Length;

            m_vertices  = (Vector3[])new Vector3[num3];
            m_triangles = new int[num4];
            for (int i = 0; i < num3; i++)
            {
                Vector2 val = vertices[i];
                num  = Mathf.Min(num, ((IntPtr)(void *)val).x);
                num2 = Mathf.Max(num2, ((IntPtr)(void *)val).x);
                m_vertices[i].Set(((IntPtr)(void *)val).x, ((IntPtr)(void *)val).y, 0f);
            }
            for (int j = 0; j < num4; j++)
            {
                m_triangles[j] = triangles[j];
            }
            m_uvs    = m_sprite.get_uv();
            num     += m_leftShift / pixelsPerUnit;
            num2    += m_rightShift / pixelsPerUnit;
            m_rect.x = num;
            m_rect.y = num2;
            m_rect.z = num2 - num;
            ref Vector4 rect  = ref m_rect;