예제 #1
0
        /// <summary>
        /// 从文件系统加载文本文件
        /// </summary>
        /// <param name="file"></param>
        /// <returns></returns>
        public IEnumerator LoadTextFileAsync(string file)
        {
            string url = null;
            WWW    www = null;

            com.QH.QPGame.GameUtils.Logger.Res.Log("load text:" + file);

#if !UNITY_EDITOR || TEST_AB
            if (downloadedABs.Contains(file))
            {
                url = GameHelper.GetDownloadPath(true) + file;
                www = new WWW(url);
                yield return(www);
            }
#endif
            if (www == null || !string.IsNullOrEmpty(www.error))
            {
                url = GameHelper.GetInternalPath(true) + file;
                www = new WWW(url);
                yield return(www);

                if (!string.IsNullOrEmpty(www.error))
                {
                    com.QH.QPGame.GameUtils.Logger.Res.Log("get file text error. Error:" + www.error + " File:" + file);
                    yield break;
                }
            }

            cachedFiles[file] = www.text;
        }
예제 #2
0
        public bool Initialize()
        {
            com.QH.QPGame.GameUtils.Logger.Res.Log("Res System Init");

            Reset();

#if !UNITY_EDITOR || TEST_AB
            if (abMgr == null)
            {
                abMgr = new LOAssetManager[2];
                for (int i = 0; i < 2; i++)
                {
                    abMgr[i]     = gameObject.AddComponent <LOAssetManager>();
                    abMgr[i].URI = i == 0 ? GameHelper.GetInternalPath(true) : GameHelper.GetDownloadPath(true);
                }
            }
#endif
            StartCoroutine(InternalInit());

            return(true);
        }
예제 #3
0
        public bool Initialize()
        {
            Account  = null;
            Password = null;
            MAC      = "";

            Host = "";
            Port = 0;

            BackStorgeUrl = "";
            CDN           = "";
            OfficeSiteUrl = "";

            EnterGameID = 0;
            EnterRoomID = 0;
            UserInfo    = null;

            PrivateKey   = "";
            TempPassword = null;
            SavePassword = false;
            TempNickName = "";


            MAC            = MacAddress.GetMacAddress();
            Host           = GameApp.Options.ServerHost;
            Port           = (uint)GameApp.Options.ServerPort;
            ForceSingleton = GameApp.Options.ForceSingleton;
            DownloadPath   = GameHelper.GetDownloadPath(false);

            Version        = GameApp.Options.Version;
            InstallVersion = "";

#if !UNITY_EDITOR && UNITY_STANDALONE_WIN
            ProcessCommandline();
#endif
            return(true);
        }
예제 #4
0
 void Awake()
 {
     downloadPath     = GameHelper.GetDownloadPath(false);
     downloadLoadPath = GameHelper.GetDownloadPath();
 }