示例#1
0
        private static Vector2 GetWSAImageTypeSize(PlayerSettings.WSAImageType type, PlayerSettings.WSAImageScale scale)
        {
            float scaleFactor = float.Parse(scale.ToString().Replace("_", "")) * 0.01f;

            switch (type)
            {
            case PlayerSettings.WSAImageType.PackageLogo:
                return(CreateSquareSize(50, scaleFactor));

            case PlayerSettings.WSAImageType.UWPSquare44x44Logo:
                return(CreateSquareSize(44, scaleFactor));

            case PlayerSettings.WSAImageType.UWPSquare71x71Logo:
                return(CreateSquareSize(71, scaleFactor));

            case PlayerSettings.WSAImageType.UWPSquare150x150Logo:
                return(CreateSquareSize(150, scaleFactor));

            case PlayerSettings.WSAImageType.UWPSquare310x310Logo:
                return(CreateSquareSize(310, scaleFactor));

            // WIDE 31:15
            case PlayerSettings.WSAImageType.UWPWide310x150Logo:
                return(CreateSize(new Vector2(310, 150), scaleFactor));

            case PlayerSettings.WSAImageType.SplashScreenImage:
                return(CreateSize(new Vector2(620, 300), scaleFactor));

            default:
                Debug.LogWarningFormat("Invalid image size for {0} with scale {1}X{2}", type, scale, scaleFactor);
                return(Vector2.zero);
            }
        }
示例#2
0
        private static Vector2 GetWSAImageTypeSize(PlayerSettings.WSAImageType type, PlayerSettings.WSAImageScale scale)
        {
            switch (type)
            {
            case PlayerSettings.WSAImageType.PackageLogo:
                return(CreateSize(50));

                return(CreateSize(150));

                return(CreateSize(30));

                return(CreateSize(70));

                return(CreateSize(310));

                return(CreateSize(44));

                return(CreateSize(71));

                return(CreateSize(150));

            case PlayerSettings.WSAImageType.UWPSquare44x44Logo:
                return(CreateSize(44));

            case PlayerSettings.WSAImageType.UWPSquare71x71Logo:
                return(CreateSize(71));

            case PlayerSettings.WSAImageType.UWPSquare150x150Logo:
                return(CreateSize(150));

            case PlayerSettings.WSAImageType.UWPSquare310x310Logo:
                return(CreateSize(310));

            // WIDE 31:15


            case PlayerSettings.WSAImageType.UWPWide310x150Logo:
                return(new Vector2(310, 150));

            case PlayerSettings.WSAImageType.SplashScreenImage:
                return(new Vector2(620, 300));

            default:
                var   size        = Vector2.zero;
                float scaleFactor = float.Parse(scale.ToString().Replace("_", "")) * 0.01f;
                size   = size * scaleFactor;
                size.x = (float)Math.Ceiling(size.x);
                size.y = (float)Math.Ceiling(size.y);

                if (size == Vector2.zero)
                {
                    Debug.LogWarningFormat("Invalid image size for {0} with scale {1}", type, scale);
                }

                return(size);
            }
        }
示例#3
0
        private static Vector2 GetWSAImageTypeSize(PlayerSettings.WSAImageType type, PlayerSettings.WSAImageScale scale)
        {
            float scaleFactor = float.Parse(scale.ToString().Replace("_", "")) * 0.01f;

            switch (type)
            {
            case PlayerSettings.WSAImageType.PackageLogo:
                return(CreateSquareSize(50, scaleFactor));

            //case PlayerSettings.WSAImageType.StoreTileLogo:
            //return CreateSquareSize(150, scaleFactor);
            //case PlayerSettings.WSAImageType.StoreTileSmallLogo:
            //return CreateSquareSize(30, scaleFactor);
            //case PlayerSettings.WSAImageType.StoreSmallTile:
            //return CreateSquareSize(70, scaleFactor);
            //case PlayerSettings.WSAImageType.StoreLargeTile:
            //return CreateSquareSize(310, scaleFactor);
            //case PlayerSettings.WSAImageType.PhoneAppIcon:
            //return CreateSquareSize(44, scaleFactor);
            //case PlayerSettings.WSAImageType.PhoneSmallTile:
            //return CreateSquareSize(71, scaleFactor);
            //case PlayerSettings.WSAImageType.PhoneMediumTile:
            //return CreateSquareSize(150, scaleFactor);
            case PlayerSettings.WSAImageType.UWPSquare44x44Logo:
                return(CreateSquareSize(44, scaleFactor));

            case PlayerSettings.WSAImageType.UWPSquare71x71Logo:
                return(CreateSquareSize(71, scaleFactor));

            case PlayerSettings.WSAImageType.UWPSquare150x150Logo:
                return(CreateSquareSize(150, scaleFactor));

            case PlayerSettings.WSAImageType.UWPSquare310x310Logo:
                return(CreateSquareSize(310, scaleFactor));

            // WIDE 31:15
            //case PlayerSettings.WSAImageType.PhoneWideTile:
            //case PlayerSettings.WSAImageType.StoreTileWideLogo:
            case PlayerSettings.WSAImageType.UWPWide310x150Logo:
                return(CreateSize(new Vector2(310, 150), scaleFactor));

            case PlayerSettings.WSAImageType.SplashScreenImage:
                return(CreateSize(new Vector2(620, 300), scaleFactor));

            //case PlayerSettings.WSAImageType.PhoneSplashScreen:
            default:
                var size = CreateSquareSize(0, scaleFactor);

                if (size == Vector2.zero)
                {
                    Debug.LogWarningFormat("Invalid image size for {0} with scale {1}", type, scale);
                }

                return(size);
            }
        }