예제 #1
0
        void Update()
        {
            if (_time > 0.3f)
            {
                RG_Utils.callAndroidJava("getMemory");
                _time = 0;
            }
            _time += Time.deltaTime;

            UpdateGameInfo();
        }
예제 #2
0
        void Start()
        {
            _width  = Screen.width;
            _height = Screen.height;
            if (Screen.height == 768 && Screen.width == 1024)
            {
                UIRoot uiroot = NGUITools.FindInParents <UIRoot>(this.gameObject);
                uiroot.scalingStyle = UIRoot.Scaling.Flexible;
            }
            else
            {
                UIRoot uiroot = NGUITools.FindInParents <UIRoot>(this.gameObject);
                uiroot.scalingStyle = UIRoot.Scaling.Constrained;
                uiroot.manualHeight = 960;

                if ((float)Screen.width / (float)Screen.height < 1.4f)
                {
                    float height = Screen.width / 1280.0f * 960 / Screen.height;
                    UICamera.mainCamera.rect = new Rect(0, (1 - height) / 2, 1, height);
                }
                if (Screen.height > 960)
                {
                    int h = 960;
                    if (Screen.height / 2 >= 960)
                    {
                        h = Screen.height / 2;
                    }
                    int    width     = (int)((float)Screen.width * h / (float)Screen.height);
                    string channelID = "";
                    channelID = RG_Utils.callAndroidJava <string>("getChannelID");
                    if (channelID != null)
                    {
                        TyLogger.Log("ChannelID = " + channelID.ToString());
                        Screen.SetResolution(width, h, true);
                        Debug.Log("SetReolution " + width + " " + h);
                        _width  = width;
                        _height = h;
                    }
                }
            }
        }
예제 #3
0
파일: Device.cs 프로젝트: clime57/Stars
        public static void collectInfo()
        {
#if UNITY_IPHONE || UNITY_EDITOR
            collectRenderInfo();
            if (SystemConfig.renderquality == Renderquality.Low)
            {
                _isMemoryNotMuch = true;
            }
#elif UNITY_ANDROID && !UNITY_EDITOR
            RG_Utils.callAndroidJava("getMaxCpuFreq");
            string graphicsDeviceName = SystemInfo.graphicsDeviceName;
            if (SystemInfo.graphicsMemorySize + SystemInfo.systemMemorySize <= 800 ||
                (SystemInfo.graphicsMemorySize + SystemInfo.systemMemorySize < 1200 &&
                 !(graphicsDeviceName.Contains("Andreno") ||
                   graphicsDeviceName.Contains("Mali") ||
                   graphicsDeviceName.Contains("PowerVR") ||
                   graphicsDeviceName.Contains("Tegra"))))
            {
                _isMemoryNotMuch = true;
                TyLogger.Log("MemoryNotMuch");
            }
            TyLogger.Log("graphicsDeviceName " + SystemInfo.graphicsDeviceName);
#endif
        }