Пример #1
0
    protected override void virAwake()
    {
        if (IsScreenLow() == false)
        {
            float size = 0.6f;
            int   x    = (int)(Screen.width * size);
            int   y    = 0;

            if (Camera.main.aspect >= 2.1)// 19.5:9
            {
                y = (int)((int)(Screen.width * size) / 19.5) * 9;
            }
            else if (Camera.main.aspect > 2)// 18.5:9
            {
                y = (int)((int)(Screen.width * size) / 18.5) * 9;
            }
            else if (Camera.main.aspect == 2)// 18:9
            {
                y = ((int)(Screen.width * size) / 18) * 9;
            }
            else if (Camera.main.aspect >= 1.7)// 16:9
            {
                y = ((int)(Screen.width * size) / 16) * 9;
            }
            else if (Camera.main.aspect > 1.6)// 5:3
            {
                y = ((int)(Screen.width * size) / 5) * 3;
            }
            else if (Camera.main.aspect == 1.6)// 16:10
            {
                y = ((int)(Screen.width * size) / 16) * 10;
            }
            else if (Camera.main.aspect >= 1.5)// 3:2
            {
                y = ((int)(Screen.width * size) / 3) * 2;
            }
            else// 4:3
            {
                y = ((int)(Screen.width * size) / 4) * 3;
            }

            Debug.Log("Screen " + Screen.width + " / " + Screen.height + " / " + x + " / " + y + " / " + Camera.main.aspect);
            Screen.SetResolution(x, y, true);
        }

        // 빌드버젼 정의 및 Config File Download 절대주소 정의
        if (CONFIG.IsRunningAndroid())
        {
#if LOCAL_DEBUG
            CONFIG.BuildSetting(new CONFIG.STVersion(1, 3, 34), "http://arthyun.asuscomm.com/SloticaMobile/");
#else
            CONFIG.BuildSetting(new CONFIG.STVersion(1, 3, 34), "https://d3kjdk8bsa0don.cloudfront.net/mobile/");
#endif
        }
        else if (CONFIG.IsRunningiOS())
        {
            CONFIG.BuildSetting(new CONFIG.STVersion(1, 0, 0), "http://arthyun.asuscomm.com/SloticaMobileHD/");
        }

#if LOCAL_DEBUG
        this.gameObject.AddComponent <FPS>();
#endif

        QualitySettings.vSyncCount  = 0;
        Application.targetFrameRate = 60;
    }