Ejemplo n.º 1
0
        private void OnGUI()
        {
            m_sceneName = GUI.TextField(new Rect(0, 0, Screen.width, 100), m_sceneName);
            if (GUI.Button(new Rect(0, 100, Screen.width, 200), "LoadScene"))
            {
                string sceneName = m_sceneName;
                Debug.LogFormat("Load Scene Name= {0}", sceneName);
                SceneManager.LoadScene(sceneName);
            }

            m_prefabName = GUI.TextField(new Rect(0, 300 + 10, Screen.width, 100), m_prefabName);
            if (GUI.Button(new Rect(0, 400, Screen.width, 200), "LoadPrefab"))
            {
                if (!string.IsNullOrEmpty(m_prefabName))
                {
                    string prefabName = string.Format("Prefab/{0}", m_prefabName);
                    Debug.LogFormat("Load Prefab Name= {0}", prefabName);
                    SimpleLoader.LoadPrefab(prefabName);
                }
            }

            m_textName = GUI.TextField(new Rect(0, 600 + 10, Screen.width, 100), m_textName);
            if (GUI.Button(new Rect(0, 700, Screen.width, 200), "LoadText"))
            {
                string textName = string.Format("Config/{0}", m_textName);
                Debug.LogFormat("Load Text Name= {0}", textName);
                string content = SimpleLoader.LoadText(textName);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取客户端版本
        /// </summary>
        private void GetClientVersion()
        {
            m_appVersion = VersionConfig.APP_VERSION;
            if (m_versionFileOnClient != null)
            {
                m_resVersion = m_versionFileOnClient.ResVersion;
                return;
            }
            string verionFilePath = string.Format("{0}/{1}", DownloadConfig.DownLoadPath, VersionConfig.VERSION_DIFF_FILE);
            // 获得上一次客户端更新到的版本
            string content = SimpleLoader.LoadText(verionFilePath);

            if (string.IsNullOrEmpty(content))
            {
                m_resVersion = VersionConfig.RES_VERSION;
            }
            else
            {
                FileHelper.ParseVersionFile(content, ref m_versionFileOnClient);
                m_resVersion = m_versionFileOnClient.ResVersion;
            }
            m_versionFlagIndex++;
            Debug.LogFormat("Client Version: {0}.{1}", m_appVersion, m_resVersion);
        }