Exemplo n.º 1
0
 public void BootInit(System.Func <string, string> fileNameToPath)
 {
     if (!string.IsNullOrEmpty(this.FileName))
     {
         File = AssetFileManager.GetFileCreateIfMissing(fileNameToPath(FileName));
     }
 }
Exemplo n.º 2
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);
            }
        }
Exemplo n.º 3
0
        //セーブデータ用のバイナリ読み込み
        internal void Read(BinaryReader reader)
        {
            int version = reader.ReadInt32();

            if (version <= Version)
            {
                PlayMode       = (SoundPlayMode)reader.ReadInt32();
                IsLoop         = reader.ReadBoolean();
                PlayVolume     = reader.ReadSingle();
                ResourceVolume = reader.ReadSingle();
                IntroTime      = reader.ReadSingle();
                Tag            = reader.ReadString();
                string filePath = reader.ReadString();
                if (version <= Version0)
                {
                    File = AssetFileManager.GetFileCreateIfMissing(filePath);
                }
                else
                {
                    string key = reader.ReadString();
                    File = AssetFileManager.GetSoundFileCreateIfMissing(filePath, key);
                }
            }
            else
            {
                Debug.LogError(LanguageErrorMsg.LocalizeTextFormat(ErrorMsg.UnknownVersion, version));
            }
        }
Exemplo n.º 4
0
 public AssetFile AddLoadFile(string path, AssetFileType assetFileType, IAssetFileSettingData settingData)
 {
     if (IsEntityType)
     {
         return(null);
     }
     return(AddLoadFileSub(AssetFileManager.GetFileCreateIfMissing(path, assetFileType, settingData)));
 }
Exemplo n.º 5
0
 /// <summary>
 /// 起動時の初期化
 /// </summary>
 /// <param name="settingData">設定データ</param>
 public override void BootInit(AdvBootSetting settingData)
 {
     foreach (AdvScenarioSettingData data in List)
     {
         AssetFile file = AssetFileManager.GetFileCreateIfMissing(ScenaioFileToPath(data.ScenaioFile));
         file.Version = data.Version;
     }
 }
Exemplo n.º 6
0
 //起動時の初期化
 public void BootInit(System.Func <string, string> FileNameToPath)
 {
     File = AssetFileManager.GetFileCreateIfMissing(FileNameToPath(fileName), RowData);
     if (File != null)
     {
         File.Version = Version;
     }
 }
Exemplo n.º 7
0
 //ロードの必要があるファイルを追加
 public AssetFile AddLoadFile(string path, StringGridRow settingData = null)
 {
     if (IsEntityType)
     {
         return(null);
     }
     return(AddLoadFile(AssetFileManager.GetFileCreateIfMissing(path, settingData)));
 }
Exemplo n.º 8
0
 //起動時の初期化
 public void BootInit(System.Func <string, string> FileNameToPath, bool ignoreLoadType)
 {
     File = AssetFileManager.GetFileCreateIfMissing(FileNameToPath(fileName));
     if (File != null)
     {
         File.IgnoreLoad |= this.IgnoreLoad || ignoreLoadType;
         File.Version     = Version;
     }
 }
Exemplo n.º 9
0
 /// <summary>
 /// 起動時の初期化
 /// </summary>
 /// <param name="settingData">設定データ</param>
 public void BootInit(AdvBootSetting settingData)
 {
     this.defaultDir = settingData.ScenarioDirInfo.defaultDir;
     this.defaultExt = settingData.ScenarioDirInfo.defaultExt;
     foreach (AdvScenarioSettingData data in List)
     {
         AssetFile file = AssetFileManager.GetFileCreateIfMissing(ScenaioFileToPath(data.ScenaioFile));
         file.Version = data.Version;
     }
 }
Exemplo n.º 10
0
        /// <summary>
        /// 起動時の初期化
        /// </summary>
        /// <param name="settingData">設定データ</param>
        internal void BootInit(AdvSettingDataManager dataManager)
        {
            Graphic.BootInit((fileName, fileType) => FileNameToPath(fileName, fileType, dataManager.BootSetting), dataManager);

            ThumbnailPath = dataManager.BootSetting.ThumbnailDirInfo.FileNameToPath(thumbnailName);
            if (!string.IsNullOrEmpty(ThumbnailPath))
            {
                AssetFileManager.GetFileCreateIfMissing(ThumbnailPath);
            }
        }
Exemplo n.º 11
0
 /// <summary>
 /// 起動時の初期化
 /// </summary>
 /// <param name="settingData">設定データ</param>
 public void BootInit(AdvBootSetting settingData)
 {
     foreach (AdvCharacterSettingData data in List)
     {
         data.BootInit(settingData);
         AssetFile file = AssetFileManager.GetFileCreateIfMissing(data.FilePath);
         file.Version          = data.Version;
         file.SpriteInfo.pivot = data.Pivot;
         file.SpriteInfo.scale = data.Scale;
     }
 }
Exemplo n.º 12
0
 /// <summary>
 /// 起動時の初期化
 /// </summary>
 /// <param name="settingData">設定データ</param>
 public void BootInit(AdvBootSetting settingData)
 {
     foreach (AdvSceneGallerySettingData data in List)
     {
         //初期化
         data.BootInit(settingData);
         //ファイルマネージャーにバージョンの登録
         AssetFile file = AssetFileManager.GetFileCreateIfMissing(data.ThumbnailPath);
         file.Version = data.ThumbnailVersion;
     }
 }
Exemplo n.º 13
0
        //ロードの必要があるファイルリスト
        public AssetFile AddLoadFile(string path)
        {
            AssetFile file = AssetFileManager.GetFileCreateIfMissing(path);

            if (loadFileList == null)
            {
                loadFileList = new List <AssetFile>();
            }
            loadFileList.Add(file);
            return(file);
        }
Exemplo n.º 14
0
        /// <summary>
        /// 起動時の初期化
        /// </summary>
        /// <param name="settingData">設定データ</param>
        internal void BootInit(AdvBootSetting settingData)
        {
            Graphic.BootInit((fileName) => FileNameToPath(fileName, settingData));

            thumbnailPath = settingData.ThumbnailDirInfo.FileNameToPath(thumbnailName);
            if (!string.IsNullOrEmpty(ThumbnailPath))
            {
                AssetFile file = AssetFileManager.GetFileCreateIfMissing(ThumbnailPath);
                if (file != null)
                {
                    file.Version = ThumbnailVersion;
                }
            }
        }
Exemplo n.º 15
0
        //起動時の初期化
        public void BootInit(Func <string, string, string> FileNameToPath, AdvSettingDataManager dataManager)
        {
            File = AssetFileManager.GetFileCreateIfMissing(FileNameToPath(FileName, FileType), this);
            //アニメーションの設定
            string animationLabel = AdvParser.ParseCellOptional <string>(RowData, AdvColumnName.Animation, "");

            if (!string.IsNullOrEmpty(animationLabel))
            {
                this.AnimationData = dataManager.AnimationSetting.Find(animationLabel);
                if (this.AnimationData == null)
                {
                    Debug.LogError(this.RowData.ToErrorString("Animation [ " + animationLabel + " ] is not found"));
                }
            }

            //目パチの設定
            string eyeBlinkLabel = AdvParser.ParseCellOptional <string>(RowData, AdvColumnName.EyeBlink, "");

            if (!string.IsNullOrEmpty(eyeBlinkLabel))
            {
                AdvEyeBlinkData data;
                if (dataManager.EyeBlinkSetting.Dictionary.TryGetValue(eyeBlinkLabel, out data))
                {
                    this.EyeBlinkData = data;
                }
                else
                {
                    Debug.LogError(this.RowData.ToErrorString("EyeBlinkLabel [ " + eyeBlinkLabel + " ] is not found"));
                }
            }

            //口パクの設定
            string lipSynchLabel = AdvParser.ParseCellOptional <string>(RowData, AdvColumnName.LipSynch, "");

            if (!string.IsNullOrEmpty(lipSynchLabel))
            {
                AdvLipSynchData data;
                if (dataManager.LipSynchSetting.Dictionary.TryGetValue(lipSynchLabel, out data))
                {
                    this.LipSynchData = data;
                }
                else
                {
                    Debug.LogError(this.RowData.ToErrorString("LipSynchLabel [ " + lipSynchLabel + " ] is not found"));
                }
            }

            //アイコンの設定
            Icon.BootInit((fileName) => dataManager.BootSetting.CharacterDirInfo.FileNameToPath(fileName));
        }
Exemplo n.º 16
0
        public void BootInit(AdvSettingDataManager dataManager)
        {
            this.FilePath = FileNameToPath(fileName, dataManager.BootSetting);
            AssetFileManager.GetFileCreateIfMissing(this.FilePath, this);

/*			if (file != null)
 *                      {
 *                              file.Version = this.Version;
 *                              //ロードタイプをストリーミングにする場合、
 *                              if (this.IsStreaming)
 *                              {
 *                                      file.AddLoadFlag(AssetFileLoadFlags.Streaming);
 *                              }
 *                      }*/
        }
Exemplo n.º 17
0
 /// <summary>
 /// 派生ファイルを追加してロードを開始させる
 /// </summary>
 public void LoadAndAddSubFile(string path)
 {
     if (!SubFiles.ContainsKey(path))
     {
         if (IsDownloadOnly)
         {
             AssetFile file = AssetFileManager.GetFileCreateIfMissing(path);
             file.Version = this.Version;
             AssetFileManager.Download(file);
         }
         else
         {
             SubFiles.Add(path, AssetFileManager.Load(path, this.Version, this));
         }
     }
 }
Exemplo n.º 18
0
        /// <summary>
        /// 起動時の初期化
        /// </summary>
        /// <param name="settingData">設定データ</param>
        public void BootInit(AdvBootSetting settingData)
        {
            foreach (AdvSoundSettingData data in List)
            {
                data.BootInit(settingData);

                AssetFile file = AssetFileManager.GetFileCreateIfMissing(data.FilePath);
                file.Version = data.Version;
                //ロードタイプをストリーミングにする場合、
                //oggはUnityのバグがあるのでストリーム読み込みを無効にする
                //バグの内容は、曲の長さがとれず一度鳴らすと終了しなくなるというもの。
                if (data.IsStreaming && !ExtensionUtil.CheckExtention(data.FilePath, ExtensionUtil.Ogg))
                {
                    file.AddLoadFlag(AssetFileLoadFlags.Streaming);
                }
            }
        }
Exemplo n.º 19
0
 //指定のファイル名をロードして鳴らす
 IEnumerator CoLoadAndPlayFile(string path, float masterVolume, float volume, bool isLoop, bool isStreaming)
 {
     if (!string.IsNullOrEmpty(path))
     {
         AssetFile file = AssetFileManager.GetFileCreateIfMissing(path);
         if (isStreaming)
         {
             file.AddLoadFlag(AssetFileLoadFlags.Streaming);
         }
         AssetFileManager.Load(file, this);
         while (!file.IsLoadEnd)
         {
             yield return(0);
         }
         file.AddReferenceComponet(this.gameObject);
         file.Unuse(this);
         Play(file.Sound, 0.1f, masterVolume, volume, isLoop, isStreaming);
     }
 }
 //指定のファイル名をロードして鳴らす
 IEnumerator CoLoadAndPlayFile(string path, float volume, bool isLoop, bool isStreaming, Func <float> callbackMasterVolume)
 {
     if (!string.IsNullOrEmpty(path))
     {
         AssetFile file = AssetFileManager.GetFileCreateIfMissing(path);
         if (isStreaming)
         {
             file.AddLoadFlag(AssetFileLoadFlags.Streaming);
         }
         AssetFileManager.Load(file, this);
         while (!file.IsLoadEnd)
         {
             yield return(0);
         }
         SoundStream stream = Play(file.Sound, 0.1f, volume, isLoop, isStreaming, callbackMasterVolume);
         stream.FadeIn(0.1f);
         file.AddReferenceComponet(stream.gameObject);
         file.Unuse(this);
     }
     isLoading = false;
 }
Exemplo n.º 21
0
        /// <summary>
        /// 起動時の初期化
        /// </summary>
        /// <param name="settingData">設定データ</param>
        public void BootInit(AdvBootSetting settingData)
        {
            //ファイルマネージャーにバージョンの登録
            foreach (AdvTextureSettingData data in List)
            {
                data.BootInit(settingData);

                {
                    AssetFile file = AssetFileManager.GetFileCreateIfMissing(data.FilePath);
                    file.Version          = data.Version;
                    file.SpriteInfo.pivot = data.Pivot;
                    file.SpriteInfo.scale = data.Scale;
                }

                if (!string.IsNullOrEmpty(data.ThumbnailPath))
                {
                    AssetFile file = AssetFileManager.GetFileCreateIfMissing(data.ThumbnailPath);
                    file.Version = data.ThumbnailVersion;
                }
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// StringGridの一行からデータ初期化
        /// </summary>
        /// <param name="row">初期化するためのデータ</param>
        /// <returns>成否</returns>
        public override bool InitFromStringGridRow(StringGridRow row, AdvBootSetting bootSetting)
        {
            string key = AdvCommandParser.ParseScenarioLabel(row, AdvColumnName.ScenarioLabel);

            InitKey(key);
            this.title            = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Title, "");
            this.thumbnailName    = AdvParser.ParseCell <string>(row, AdvColumnName.Thumbnail);
            this.thumbnailVersion = AdvParser.ParseCellOptional <int>(row, AdvColumnName.ThumbnailVersion, 0);
            this.category         = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Categolly, "");
            this.RowData          = row;

            this.thumbnailPath = bootSetting.ThumbnailDirInfo.FileNameToPath(thumbnailName);
            //ファイルマネージャーにバージョンの登録
            AssetFile file = AssetFileManager.GetFileCreateIfMissing(this.ThumbnailPath);

            if (file != null)
            {
                file.Version = this.ThumbnailVersion;
            }

            return(true);
        }
Exemplo n.º 23
0
        /// <summary>
        /// StringGridの一行からデータ初期化
        /// </summary>
        /// <param name="row">初期化するためのデータ</param>
        /// <returns>成否</returns>
        public override bool InitFromStringGridRow(StringGridRow row, AdvBootSetting bootSetting)
        {
            if (row.IsEmptyOrCommantOut)
            {
                return(false);
            }

            this.RowData = row;
            string key = AdvParser.ParseCell <string>(row, AdvColumnName.Label);

            if (string.IsNullOrEmpty(key))
            {
                return(false);
            }
            else
            {
                InitKey(key);
                this.type        = AdvParser.ParseCell <SoundType>(row, AdvColumnName.Type);
                this.fileName    = AdvParser.ParseCell <string>(row, AdvColumnName.FileName);
                this.isStreaming = AdvParser.ParseCellOptional <bool>(row, AdvColumnName.Streaming, false);
                this.version     = AdvParser.ParseCellOptional <int>(row, AdvColumnName.Version, 0);
                this.title       = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Title, "");

                this.filePath = FileNameToPath(fileName, bootSetting);
                AssetFile file = AssetFileManager.GetFileCreateIfMissing(this.FilePath, this.RowData);
                if (file != null)
                {
                    file.Version = this.Version;
                    //ロードタイプをストリーミングにする場合、
                    if (this.IsStreaming)
                    {
                        file.AddLoadFlag(AssetFileLoadFlags.Streaming);
                    }
                }

                return(true);
            }
        }
Exemplo n.º 24
0
 //ロードの必要があるファイルを追加
 public AssetFile AddLoadFile(string path)
 {
     return(AddLoadFile(AssetFileManager.GetFileCreateIfMissing(path)));
 }
Exemplo n.º 25
0
 public GraphicInfo(string filePath)
 {
     Debug.Log("Warning");
     File = AssetFileManager.GetFileCreateIfMissing(filePath);
 }
Exemplo n.º 26
0
 public GraphicInfo(string filePath)
 {
     File = AssetFileManager.GetFileCreateIfMissing(filePath);
 }
Exemplo n.º 27
0
		//ロードの必要があるファイルを追加
		public AssetFile AddLoadFile(string path, IAssetFileSettingData settingData )
		{
			if (IsEntityType) return null;
			return AddLoadFileSub(AssetFileManager.GetFileCreateIfMissing(path, settingData));
		}