Beispiel #1
0
        string FileNameToPath(string fileName, AdvBootSetting settingData)
        {
            string root = null;

            if (CallbackParseCustomFileTypeRootDir != null)
            {
                CallbackParseCustomFileTypeRootDir(this.graphic.FileType, ref root);
            }
            if (root != null)
            {
                return(FilePathUtil.Combine(settingData.ResorceDir, root, fileName));
            }
            else
            {
                if (!Graphic.IsDefaultFileType)
                {
                    return(FilePathUtil.Combine(settingData.ResorceDir, fileName));
                }
                else
                {
                    switch (type)
                    {
                    case AdvTextureSettingData.Type.Event:
                        return(settingData.EventDirInfo.FileNameToPath(fileName));

                    case AdvTextureSettingData.Type.Sprite:
                        return(settingData.SpriteDirInfo.FileNameToPath(fileName));

                    case AdvTextureSettingData.Type.Bg:
                    default:
                        return(settingData.BgDirInfo.FileNameToPath(fileName));
                    }
                }
            }
        }
        //起動用CSVをコンバート
        CsvInfo ConvertBootSetting(int version)
        {
            StringGrid grid = AdvBootSetting.CreateOnCsvOnvert(bootSettingGrid, version);
            string     path = AdvSettingDataManager.SheetNameBoot;

            return(new CsvInfo(grid, path));
        }
Beispiel #3
0
 public override void ParseGrid(StringGrid grid, AdvBootSetting bootSetting)
 {
     base.ParseGrid(grid, bootSetting);
     InitDefault(AdvLayerSettingData.LayerType.Bg, 0);
     InitDefault(AdvLayerSettingData.LayerType.Character, 100);
     InitDefault(AdvLayerSettingData.LayerType.Sprite, 200);
 }
Beispiel #4
0
        protected override void OnParseGrid(StringGrid grid, AdvBootSetting bootSetting)
        {
            if (GridList.Count == 0)
            {
                Debug.LogError("Old Version Reimport Excel Scenario Data");
                return;
            }

            string            sheetName = grid.SheetName;
            AdvParamStructTbl data;

            if (!StructTbl.TryGetValue(sheetName, out data))
            {
                data = new AdvParamStructTbl();
                StructTbl.Add(sheetName, data);
            }

            if (sheetName == SheetNameParam)
            {
                data.AddSingle(grid);
            }
            else
            {
                data.AddTbl(grid);
            }
        }
        //起動用CSVをコンバート
        void WriteBootSetting(string folderPath, int version)
        {
            StringGrid grid       = AdvBootSetting.CreateOnCsvOnvert(bootSettingGrid, version);
            string     outPutPath = folderPath + "/" + AdvSettingDataManager.SheetNameBoot + extConvert;

            WriteFile(grid, outPutPath);
        }
        /// <summary>
        /// 起動時の初期化
        /// </summary>
        /// <param name="settingData">設定データ</param>
        public void BootInit(AdvBootSetting settingData)
        {
            BootInit();

            InitDefault(AdvLayerSettingData.LayerType.Bg, 0);
            InitDefault(AdvLayerSettingData.LayerType.Character, 100);
            InitDefault(AdvLayerSettingData.LayerType.Sprite, 200);
        }
 //連続するデータとして追加できる場合はする。基本はしない
 protected virtual bool TryParseContiunes(T last, StringGridRow row, AdvBootSetting bootSetting)
 {
     if (last == null)
     {
         return(false);
     }
     return(false);
 }
Beispiel #8
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;
     }
 }
/*
 *              /// <summary>
 *              /// StringGridのデータ解析
 *              /// </summary>
 *              /// <param name="grid">解析するデータ</param>
 *              protected override void ParseFromStringGrid(StringGrid grid)
 *              {
 *                      defaultKey.Clear();
 *                      string name = "";
 *                      string nameText = "";
 *                      foreach (StringGridRow row in grid.Rows)
 *                      {
 *                              if (row.RowIndex < grid.DataTopRow) continue;			//データの行じゃない
 *                              if (row.IsEmpty) continue;								//データがない
 *                              //名前は空白なら、直前のものと同じ
 *                              string newName = AdvParser.ParseCellOptional<string>(row,AdvColumnName.CharacterName, name);
 *                              if(newName!=name)
 *                              {
 *                                      name = newName;
 *                                      nameText = "";
 *                              }
 *                              //表示パターン
 *                              string pattern = ToDataKey(name, AdvParser.ParseCellOptional<string>(row, AdvColumnName.Pattern, ""));
 *
 *                              //表示名は空白なら、直前のものと同じ
 *                              nameText = AdvParser.ParseCellOptional<string>(row, AdvColumnName.NameText, nameText);
 *
 *                              //データ追加
 *                              AdvCharacterSettingData data = new AdvCharacterSettingData();
 *                              data.Init(pattern,
 *                                      string.IsNullOrEmpty(nameText) ? name : nameText,
 *                                      row);
 *                              Add(data);
 *                              if (!defaultKey.ContainsKey(name))
 *                              {
 *                                      defaultKey.Add(name, pattern);
 *                              }
 *                      }
 *              }
 */
        /// <summary>
        /// 起動時の初期化
        /// </summary>
        /// <param name="settingData">設定データ</param>
        public void BootInit(AdvBootSetting settingData)
        {
            defaultKey.Clear();
            BootInit();
            foreach (AdvCharacterSettingData data in List)
            {
                data.BootInit(settingData);
            }
        }
Beispiel #10
0
        protected override void OnParseGrid(StringGrid grid, AdvBootSetting bootSetting)
        {
            LanguageManagerBase languageManager = LanguageManagerBase.Instance;

            if (languageManager != null)
            {
                languageManager.OverwriteData(grid);
            }
        }
        void AddFileDataToTsv(StringGrid grid, int version, string excelFileName, string sheetName)
        {
            const string format = "{0}/Settings/{1}.tsv";
            string       tag    = AdvBootSetting.GetTagName(sheetName);

            grid.AddRow(new List <string> {
                tag, string.Format(format, excelFileName, sheetName), "" + version
            });
        }
 /// <summary>
 /// 起動時の初期化
 /// </summary>
 /// <param name="settingData">設定データ</param>
 public void BootInit(AdvBootSetting settingData)
 {
     BootInit();
     //ファイルマネージャーにバージョンの登録
     foreach (AdvTextureSettingData data in List)
     {
         data.BootInit(settingData);
     }
 }
 /// <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;
     }
 }
Beispiel #14
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;
     }
 }
Beispiel #15
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;
     }
 }
 /// <summary>
 /// データをクリア
 /// </summary>
 public void Clear()
 {
     settingData = new AdvBootSetting();
     LayerSetting.Clear();
     CharacterSetting.Clear();
     TextureSetting.Clear();
     SoundSetting.Clear();
     ScenarioSetting.Clear();
     DefaultParam.Clear();
     SceneGallerySetting.Clear();
 }
Beispiel #17
0
 /// <summary>
 /// CSVにコンバートする際起動用のBootファイルを作成
 /// </summary>
 /// <param name="grid">エクセル側のデータ</param>
 public static StringGrid CreateOnCsvOnvert(StringGrid grid, int version)
 {
     if (grid == null)
     {
         grid = new StringGrid(AdvSettingDataManager.SheetNameBoot, CsvType.Tsv);
         grid.AddRow(new List <string> {
             AdvParser.Localize(AdvColumnName.Tag), AdvParser.Localize(AdvColumnName.Param1), AdvParser.Localize(AdvColumnName.Version)
         });
     }
     ///起動用データをコンバート
     AdvBootSetting.AddDefaultUrlSettingsOnCsvOnvert(grid, version);
     return(grid);
 }
Beispiel #18
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;
                }
            }
        }
Beispiel #19
0
        string FileNameToPath(string fileName, AdvBootSetting settingData)
        {
            switch (type)
            {
            case AdvTextureSettingData.Type.Event:
                return(settingData.EventDirInfo.FileNameToPath(fileName));

            case AdvTextureSettingData.Type.Sprite:
                return(settingData.SpriteDirInfo.FileNameToPath(fileName));

            case AdvTextureSettingData.Type.Bg:
            default:
                return(settingData.BgDirInfo.FileNameToPath(fileName));
            }
        }
Beispiel #20
0
        string FileNameToPath(string fileName, AdvBootSetting settingData)
        {
            switch (Type)
            {
            case SoundType.Se:
                return(settingData.SeDirInfo.FileNameToPath(fileName));

            case SoundType.Ambience:
                return(settingData.AmbienceDirInfo.FileNameToPath(fileName));

            case SoundType.Bgm:
            default:
                return(settingData.BgmDirInfo.FileNameToPath(fileName));
            }
        }
        string FileNameToPath(string fileName, string fileType, AdvBootSetting settingData)
        {
            string root = null;

            if (CallbackParseCustomFileTypeRootDir != null)
            {
                CallbackParseCustomFileTypeRootDir(fileType, ref root);
                if (root != null)
                {
                    return(FilePathUtil.Combine(settingData.ResourceDir, root, fileName));
                }
            }

            return(settingData.CharacterDirInfo.FileNameToPath(fileName));
        }
Beispiel #22
0
        /// <summary>
        /// StringGridの一行からデータ初期化
        /// </summary>
        /// <param name="row">初期化するためのデータ</param>
        /// <returns>成否</returns>
        public override bool InitFromStringGridRow(StringGridRow row, AdvBootSetting bootSetting)
        {
            this.RowData = row;
            string key = AdvParser.ParseCell <string>(row, AdvColumnName.Label);

            InitKey(key);
            this.type             = AdvParser.ParseCell <Type>(row, AdvColumnName.Type);
            this.graphic          = new GraphicInfoList(AdvGraphicInfoParser.TypeTexture, key, AdvParser.ParseCellOptional <string>(row, AdvColumnName.FileType, ""));
            this.thumbnailName    = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Thumbnail, "");
            this.thumbnailVersion = AdvParser.ParseCellOptional <int>(row, AdvColumnName.ThumbnailVersion, 0);
            this.cgCategolly      = AdvParser.ParseCellOptional <string>(row, AdvColumnName.CgCategolly, "");
            this.AddGraphicInfo(row);
            this.BootInit(bootSetting);
            return(true);
        }
        string FileNameToPath(string fileName, AdvBootSetting settingData)
        {
            string root = null;

            if (CallbackParseCustomFileTypeRootDir != null)
            {
                CallbackParseCustomFileTypeRootDir(this.graphic.FileType, ref root);
            }
            if (root != null)
            {
                return(settingData.ResorceDir + root + "/" + fileName);
            }
            else
            {
                return(settingData.CharacterDirInfo.FileNameToPath(fileName));
            }
        }
Beispiel #24
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);
                }
            }
        }
        /// <summary>
        /// 起動時の初期化
        /// </summary>
        /// <param name="settingData">設定データ</param>
        public void BootInit(AdvBootSetting settingData)
        {
            Graphic.BootInit((fileName) => FileNameToPath(fileName, settingData));

            //特定のファイルタイプなら、ロード終了時の処理をする
            if (CallbackParseCustomFileTypeLoadComplete != null && !AssetFileManager.IsEditorErrorCheck)
            {
                AssetFileLoadComplete onLoadComplete = null;
                CallbackParseCustomFileTypeLoadComplete(this.graphic.FileType, ref onLoadComplete);
                if (onLoadComplete != null)
                {
                    foreach (GraphicInfo info in Graphic.InfoList)
                    {
                        info.File.OnLoadComplete += onLoadComplete;
                    }
                }
            }
        }
Beispiel #26
0
        /// <summary>
        /// StringGridの一行からデータ初期化
        /// </summary>
        /// <param name="row">初期化するためのデータ</param>
        /// <returns>成否</returns>
        public override bool InitFromStringGridRow(StringGridRow row, AdvBootSetting bootSetting)
        {
            RowData = row;
            string key = AdvParser.ParseCell <string>(row, AdvColumnName.LayerName);

            if (string.IsNullOrEmpty(key))
            {
                return(false);
            }
            else
            {
                InitKey(key);
                this.type = AdvParser.ParseCell <LayerType>(row, AdvColumnName.Type);
                this.center.Set(AdvParser.ParseCellOptional <float>(row, AdvColumnName.X, 0), AdvParser.ParseCellOptional <float>(row, AdvColumnName.Y, 0));
                this.order     = AdvParser.ParseCell <int>(row, AdvColumnName.Order);
                this.layerMask = AdvParser.ParseCellOptional <string>(row, AdvColumnName.LayerMask, "");
                this.z         = AdvParser.ParseCellOptional <float>(row, AdvColumnName.Z, float.MinValue);
                return(true);
            }
        }
        //連続するデータとして追加できる場合はする。基本はしない
        protected virtual T ParseFromStringGridRow(T last, StringGridRow row, AdvBootSetting bootSetting)
        {
            T data = new T();

            if (data.InitFromStringGridRowMain(row, bootSetting))
            {
                if (!Dictionary.ContainsKey(data.Key))
                {
                    AddData(data);
                    return(data);
                }
                else
                {
                    string errorMsg = "";
                    errorMsg += row.ToErrorString(ColorUtil.AddColorTag(data.Key, Color.red) + "  is already contains");
                    Debug.LogError(errorMsg);
                }
            }
            return(null);
        }
Beispiel #28
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;
                }
            }
        }
Beispiel #29
0
        /// <summary>
        /// 起動時の初期化
        /// </summary>
        /// <param name="settingData">設定データ</param>
        internal void BootInit(AdvBootSetting settingData)
        {
            Graphic.BootInit((fileName) => FileNameToPath(fileName, settingData));
#pragma warning disable 0612

            //特定のファイルタイプなら、ロード終了時の処理をする
            if (CallbackParseCustomFileTypeLoadComplete != null && !AssetFileManager.IsEditorErrorCheck)
            {
                Debug.LogWarning("Old Type. Dont use CallbackParseCustomFileTypeLoadComplete");
                AssetFileLoadComplete onLoadComplete = null;
                CallbackParseCustomFileTypeLoadComplete(this.graphic.FileType, ref onLoadComplete);
                if (onLoadComplete != null)
                {
                    foreach (GraphicInfo info in Graphic.InfoList)
                    {
                        info.File.OnLoadComplete = (x => onLoadComplete(x));
                    }
                }
            }
#pragma warning restore 0612
        }
Beispiel #30
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);
        }
		/// <summary>
		/// データをクリア
		/// </summary>
		public void Clear()
		{
			settingData = new AdvBootSetting();
			LayerSetting.Clear();
			CharacterSetting.Clear();
			TextureSetting.Clear();
			SoundSetting.Clear();
			ScenarioSetting.Clear();
			DefaultParam.Clear();
			SceneGallerySetting.Clear();
			PageContoroller.Clear();
		}