コード例 #1
0
ファイル: HudFreskoView.cs プロジェクト: acosin/MMXLegacy
        private void OnResolutionChange()
        {
            if (!m_fresko.gameObject.activeSelf)
            {
                return;
            }
            Texture2D texture2D;

            switch (GraphicsConfigManager.GetAspectRatio())
            {
            case EAspectRatio._16_9:
                texture2D = LocalResourcePathAttribute.LoadAsset <Texture2D>(m_freskoTexture_169);
                goto IL_6F;

            case EAspectRatio._16_10:
                texture2D = LocalResourcePathAttribute.LoadAsset <Texture2D>(m_freskoTexture_1610);
                goto IL_6F;
            }
            texture2D = LocalResourcePathAttribute.LoadAsset <Texture2D>(m_freskoTexture_43);
IL_6F:
            if (m_fresko.mainTexture != texture2D)
            {
                Texture mainTexture = m_fresko.mainTexture;
                m_fresko.mainTexture = texture2D;
                if (mainTexture != null)
                {
                    mainTexture.UnloadAsset();
                }
                m_fresko.MakePixelPerfect();
            }
        }
コード例 #2
0
        private void OnResolutionChange()
        {
            EAspectRatio easpectRatio = GraphicsConfigManager.GetAspectRatio();

            if (easpectRatio == EAspectRatio.None)
            {
                easpectRatio = EAspectRatio._4_3;
            }
            m_background.mainTexture = ((easpectRatio != EAspectRatio._4_3) ? m_backgroundTexture169 : m_backgroundTexture43);
            m_background.MakePixelPerfect();
        }
コード例 #3
0
ファイル: MainGUILogic.cs プロジェクト: acosin/MMXLegacy
        private void OnResolutionChange()
        {
            EAspectRatio easpectRatio = GraphicsConfigManager.GetAspectRatio();

            if (easpectRatio == EAspectRatio.None)
            {
                easpectRatio = EAspectRatio._4_3;
            }
            Texture mainTexture = (easpectRatio != EAspectRatio._4_3) ? m_backgroundTexture169 : m_backgroundTexture43;

            if (LegacyLogic.Instance.ModController.InModMode)
            {
                ModController.ModInfo currentMod = LegacyLogic.Instance.ModController.CurrentMod;
                if (!String.IsNullOrEmpty(currentMod.TitleImage))
                {
                    String path = Path.Combine(currentMod.ImageFolder, currentMod.TitleImage);
                    if (File.Exists(path))
                    {
                        if (m_createdBackground == null)
                        {
                            m_createdBackground           = new Texture2D(1, 1, TextureFormat.ARGB32, false);
                            m_createdBackground.hideFlags = HideFlags.DontSave;
                        }
                        Byte[] data = File.ReadAllBytes(path);
                        if (m_createdBackground.LoadImage(data))
                        {
                            mainTexture = m_createdBackground;
                        }
                    }
                }
            }
            m_background.mainTexture = mainTexture;
            if (easpectRatio == EAspectRatio._4_3)
            {
                m_background.transform.localScale = new Vector3(2048f, 1536f, 1f);
            }
            else
            {
                m_background.transform.localScale = new Vector3(2732f, 1536f, 1f);
            }
        }