示例#1
0
        private void initWorldUITransformFactor(Vector2 mapImgSize, SLevelContext levelContext, bool bMiniMap, out Vector2 world_UI_Factor, out Vector2 UI_world_Factor)
        {
            int   num  = !bMiniMap ? levelContext.m_bigMapWidth : levelContext.m_mapWidth;
            int   num2 = !bMiniMap ? levelContext.m_bigMapHeight : levelContext.m_mapHeight;
            float x    = mapImgSize.x / ((float)num);
            float y    = mapImgSize.y / ((float)num2);

            world_UI_Factor = new Vector2(x, y);
            float num5 = ((float)num) / mapImgSize.x;
            float num6 = ((float)num2) / mapImgSize.y;

            UI_world_Factor = new Vector2(num5, num6);
            if (levelContext.m_isCameraFlip)
            {
                world_UI_Factor = new Vector2(-x, -y);
                UI_world_Factor = new Vector2(-num5, -num6);
            }
            GameObject obj2 = !bMiniMap ? this.bmRoot : this.mmRoot;

            if (obj2 != null)
            {
                Image2 component = obj2.GetComponent <Image2>();
                if (component != null)
                {
                    float num7 = !bMiniMap ? levelContext.m_bigMapFowScale : levelContext.m_mapFowScale;
                    float num8 = !levelContext.m_isCameraFlip ? 1f : 0f;
                    component.SetMaterialVector("_FowParams", new Vector4(num7, num8, 1f, 1f));
                }
            }
        }