Пример #1
0
        /// <summary>
        /// コマンド名なしの場合のコマンドIDを取得
        /// </summary>
        /// <param name="row">行データ</param>
        /// <param name="dataManager">データマネージャー</param>
        /// <returns>生成するコマンドID</returns>
        static string ParseCommandID(StringGridRow row)
        {
            Profiler.BeginSample("ParseCommandID");
            string id = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Command, "");

            if (string.IsNullOrEmpty(id))
            {
                //コマンドなしは、テキスト表示が基本
                if (!AdvParser.IsEmptyCell(row, AdvColumnName.Arg1))
                {
                    Profiler.EndSample();
                    //パラメーターつきなので、キャラ表示
                    return(IdCharacter);
                }
                if (!AdvParser.IsEmptyCell(row, AdvColumnName.Text) || !AdvParser.IsEmptyCell(row, AdvColumnName.PageCtrl))
                {
                    Profiler.EndSample();
                    //テキスト表示
                    return(IdText);
                }
                else
                {                   //なにもないので空データ
                    Profiler.EndSample();
                    return(null);
                }
            }
            else if (IsScenarioLabel(id))
            {
                //シナリオラベル
                id = IdScenarioLabel;
            }
            Profiler.EndSample();
            return(id);
        }
Пример #2
0
 public AdvFaceIconInfo(StringGridRow row)
 {
     this.FileName = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Icon, "");
     if (!string.IsNullOrEmpty(FileName))
     {
         if (!AdvParser.IsEmptyCell(row, AdvColumnName.IconSubFileName))
         {
             this.IconType        = AdvFaceIconInfo.Type.DicingPattern;
             this.IconSubFileName = AdvParser.ParseCell <string>(row, AdvColumnName.IconSubFileName);
         }
         else
         {
             this.IconType = AdvFaceIconInfo.Type.IconImage;
         }
     }
     else if (!AdvParser.IsEmptyCell(row, AdvColumnName.IconRect))
     {
         float[] rect = row.ParseCellArray <float>(AdvColumnName.IconRect.QuickToString());
         if (rect.Length == 4)
         {
             this.IconType = AdvFaceIconInfo.Type.RectImage;
             this.IconRect = new Rect(rect[0], rect[1], rect[2], rect[3]);
         }
         else
         {
             Debug.LogError(row.ToErrorString("IconRect. Array size is not 4"));
         }
     }
     else
     {
         this.IconType = Type.None;
     }
 }
Пример #3
0
 /// <summary>
 /// 初期化
 /// </summary>
 /// <param name="key">キー(キャラ名を)</param>
 /// <param name="fileName">ファイルネーム</param>
 internal void Init(string name, string pattern, string nameText, StringGridRow row)
 {
     this.name    = name;
     this.pattern = pattern;
     this.InitKey(AdvCharacterSetting.ToDataKey(name, pattern));
     this.nameText = nameText;
     this.graphic  = new GraphicInfoList(AdvGraphicInfoParser.TypeCharacter, Key, AdvParser.ParseCellOptional <string>(row, AdvColumnName.FileType, ""));
     if (!AdvParser.IsEmptyCell(row, AdvColumnName.FileName))
     {
         AddGraphicInfo(row);
     }
 }
Пример #4
0
 /// <summary>
 /// 初期化
 /// </summary>
 /// <param name="key">キー(キャラ名を)</param>
 /// <param name="fileName">ファイルネーム</param>
 internal void Init(string name, string pattern, string nameText, StringGridRow row)
 {
     this.name    = name;
     this.pattern = pattern;
     this.RowData = row;
     this.InitKey(AdvCharacterSetting.ToDataKey(name, pattern));
     this.nameText = nameText;
     this.graphic  = new AdvGraphicInfoList(Key);
     if (!AdvParser.IsEmptyCell(row, AdvColumnName.FileName))
     {
         AddGraphicInfo(row);
     }
 }
Пример #5
0
        /// <summary>
        /// StringGridの一行からデータ初期化
        /// </summary>
        /// <param name="row">初期化するためのデータ</param>
        /// <returns>成否</returns>
        public override bool InitFromStringGridRow(StringGridRow row)
        {
            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.Order     = AdvParser.ParseCell <int>(row, AdvColumnName.Order);
                this.LayerMask = AdvParser.ParseCellOptional <string>(row, AdvColumnName.LayerMask, "");

                //X座標や幅の設定
                this.Horizontal = new RectSetting();
                bool isBorderLeft  = !AdvParser.IsEmptyCell(row, AdvColumnName.BorderLeft);
                bool isBorderRight = !AdvParser.IsEmptyCell(row, AdvColumnName.BorderRight);
                if (isBorderLeft)
                {
                    this.Horizontal.type = (isBorderRight) ? BorderType.Streach : BorderType.BorderMin;
                }
                else
                {
                    this.Horizontal.type = (isBorderRight) ? BorderType.BorderMax : BorderType.None;
                }
                Horizontal.position  = AdvParser.ParseCellOptional <float>(row, AdvColumnName.X, 0);
                Horizontal.size      = AdvParser.ParseCellOptional <float>(row, AdvColumnName.Width, 0);
                Horizontal.borderMin = AdvParser.ParseCellOptional <float>(row, AdvColumnName.BorderLeft, 0);
                Horizontal.borderMax = AdvParser.ParseCellOptional <float>(row, AdvColumnName.BorderRight, 0);


                //Y座標や高さの設定
                this.Vertical = new RectSetting();
                bool isBorderTop    = !AdvParser.IsEmptyCell(row, AdvColumnName.BorderTop);
                bool isBorderBottom = !AdvParser.IsEmptyCell(row, AdvColumnName.BorderBottom);
                if (isBorderTop)
                {
                    this.Vertical.type = (isBorderBottom) ? BorderType.Streach : BorderType.BorderMax;
                }
                else
                {
                    this.Vertical.type = (isBorderBottom) ? BorderType.BorderMin : BorderType.None;
                }
                Vertical.position  = AdvParser.ParseCellOptional <float>(row, AdvColumnName.Y, 0);
                Vertical.size      = AdvParser.ParseCellOptional <float>(row, AdvColumnName.Height, 0);
                Vertical.borderMin = AdvParser.ParseCellOptional <float>(row, AdvColumnName.BorderBottom, 0);
                Vertical.borderMax = AdvParser.ParseCellOptional <float>(row, AdvColumnName.BorderTop, 0);


                Vector2 pivot;
                pivot.x    = AdvParser.ParseCellOptional <float>(row, AdvColumnName.PivotX, 0.5f);
                pivot.y    = AdvParser.ParseCellOptional <float>(row, AdvColumnName.PivotY, 0.5f);
                this.Pivot = pivot;

                Vector3 scale;
                scale.x    = AdvParser.ParseCellOptional <float>(row, AdvColumnName.ScaleX, 1.0f);
                scale.y    = AdvParser.ParseCellOptional <float>(row, AdvColumnName.ScaleY, 1.0f);
                scale.z    = AdvParser.ParseCellOptional <float>(row, AdvColumnName.ScaleZ, 1.0f);
                this.Scale = scale;

                this.Z         = AdvParser.ParseCellOptional <float>(row, AdvColumnName.Z, -0.01f * Order);
                this.Alignment = AdvParser.ParseCellOptional <Alignment>(row, AdvColumnName.Align, Alignment.None);
                this.FlipX     = AdvParser.ParseCellOptional <bool>(row, AdvColumnName.FlipX, false);
                this.FlipY     = AdvParser.ParseCellOptional <bool>(row, AdvColumnName.FlipY, false);
                return(true);
            }
        }