Exemplo n.º 1
0
        //**************************** CSVのロード用 ****************************//

        /// <summary>
        /// CSVファイルからロードして初期化
        /// </summary>
        /// <param name="parent">コルーチンをまわすためのMonoBehaviour</param>
        /// <param name="url">ファイルパス</param>
        /// <param name="version">シナリオバージョン(-1以下で必ずサーバーからデータを読み直す)</param>
        /// <returns></returns>
        public IEnumerator LoadCsvAsync(MonoBehaviour parent, string url, int version)
        {
            //起動ファイルの読み込み
            {
                AssetFile file = AssetFileManager.GetFileCreateIfMissing(url);
                if (version < 0)
                {
                    file.Version = file.CacheVersion + 1;
                }
                AssetFileManager.Load(file, this);
                while (!file.IsLoadEnd)
                {
                    yield return(0);
                }
                SettingData.InitFromCsv(file.Csv, url);
                file.Unuse(this);
            }

            parent.StartCoroutine(ScenarioSetting.LoadCsvAsync(SettingData.ScenarioSettingUrlList));
            parent.StartCoroutine(CharacterSetting.LoadCsvAsync(SettingData.CharacterSettingUrlList));
            parent.StartCoroutine(TextureSetting.LoadCsvAsync(SettingData.TextureSettingUrlList));
            parent.StartCoroutine(SoundSetting.LoadCsvAsync(SettingData.SoundSettingUrlList));
            parent.StartCoroutine(DefaultParam.LoadCsvAsync(SettingData.ParamSettingUrlList));
            parent.StartCoroutine(LayerSetting.LoadCsvAsync(SettingData.LayerSettingUrlList));
            parent.StartCoroutine(SceneGallerySetting.LoadCsvAsync(SettingData.SceneGallerySettingUrlList));


            while (!IsLoadEndCsv())
            {
                yield return(0);
            }
        }
        //**************************** CSVのロード用 ****************************//

        /// <summary>
        /// CSVファイルからロードして初期化
        /// </summary>
        /// <param name="parent">コルーチンをまわすためのMonoBehaviour</param>
        /// <param name="url">ファイルパス</param>
        /// <param name="version">シナリオバージョン(-1以下で必ずサーバーからデータを読み直す)</param>
        /// <returns></returns>
        public IEnumerator LoadCsvAsync(MonoBehaviour parent, string url, int version)
        {
            //起動ファイルの読み込み
            {
                AssetFile file = AssetFileManager.Load(url, version, this);
                Debug.Log("Boot Scenario Version:" + file.Version);
                while (!file.IsLoadEnd)
                {
                    yield return(0);
                }
                SettingData.InitFromCsv(file.Csv, url);
                file.Unuse(this);
            }

            importVersion = Version;

            parent.StartCoroutine(ScenarioSetting.LoadCsvAsync(SettingData.ScenarioSettingUrlList));
            parent.StartCoroutine(CharacterSetting.LoadCsvAsync(SettingData.CharacterSettingUrlList));
            parent.StartCoroutine(TextureSetting.LoadCsvAsync(SettingData.TextureSettingUrlList));
            parent.StartCoroutine(SoundSetting.LoadCsvAsync(SettingData.SoundSettingUrlList));
            parent.StartCoroutine(DefaultParam.LoadCsvAsync(SettingData.ParamSettingUrlList));
            parent.StartCoroutine(LayerSetting.LoadCsvAsync(SettingData.LayerSettingUrlList));
            parent.StartCoroutine(SceneGallerySetting.LoadCsvAsync(SettingData.SceneGallerySettingUrlList));


            while (!IsLoadEndCsv())
            {
                yield return(0);
            }
        }