예제 #1
0
파일: LoadScene.cs 프로젝트: clime57/Stars
 void SceneHideLoading()
 {
     //UIhide() or Destroy;
     if (_hideLoadingCallBack != null)
     {
         TyLogger.Log("SceneHideLoading _hideLoadingCallBack -> only for test clime");
         _hideLoadingCallBack();
         _hideLoadingCallBack = null;
     }
 }
예제 #2
0
 void autoReleaseRes()
 {
     _destroyWinCount++;
     if (_resReleaseSw.ElapsedMilliseconds > _maxDestroyWinAutoReleaseResTime && _destroyWinCount > _maxDestroyWinAutoReleaseResCount)
     {
         Resources.UnloadUnusedAssets();
         _resReleaseSw.Reset();
         _resReleaseSw.Start();
         _destroyWinCount = 0;
         TyLogger.Log("UIWindowManager AutoReleaseRes");
     }
 }
예제 #3
0
파일: LoadScene.cs 프로젝트: clime57/Stars
 public void resetWhenBackToLogin()
 {
     TyLogger.Log("loading resetWhenBackToLogin");
     StopAllCoroutines();
     if (bundle != null)
     {
         bundle.Unload(false);
         bundle = null;
     }
     _isLoading             = false;
     async                  = null;
     _loadingEndPreCallBack = null;
     _loadingEndCallBack    = null;
     CancelInvoke();
 }
예제 #4
0
        IEnumerator <UnityWebRequest> ReqGameSvr(string id)
        {
            string url = "http://test.sporger.com:9040/login/platform?id=" + id;

            TyLogger.Log("url=" + url);
            UnityWebRequest www = new UnityWebRequest(url);

            yield return(www);

            if (!string.IsNullOrEmpty(www.error))
            {
                TyLogger.Log(www.error);
            }
            else
            {
                TyLogger.Log(www.downloadHandler.text);
                //HttpLoginCallbackData httpLoginCallbackData = LitJson.JsonMapper.ToObject<HttpLoginCallbackData>(getData.text);
            }
            yield return(null);
        }
예제 #5
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;
                    }
                }
            }
        }
예제 #6
0
파일: LoadConfig.cs 프로젝트: clime57/Stars
    void DataCallBackHandler(AssetBundleInfo info)
    {
        TextAsset textAsset = info.mainObject as TextAsset;

        if (textAsset == null)
        {
            Debug.LogError("can not found this table:" + configType);
            return;
        }
        TyLogger.Log("ConfigCollect.CONFIG_ARRAY:" + configType);
        IFormatter formatter = new BinaryFormatter();

        formatter.Binder = new UBinder();
        MemoryStream stream = new MemoryStream(textAsset.bytes);

        object[]  dataArr    = formatter.Deserialize(stream) as object[];
        IConfig[] iConfigArr = Array.ConvertAll <object, IConfig>(dataArr, delegate(object s) { return(s as IConfig); });
        ConfigDataManager.addConfigData(configType, iConfigArr);
        stream.Close();
        _loadProgress = 1.0f;
        _loadState    = 3;
    }
예제 #7
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
        }