public AdvEffectDataShake(StringGridRow row)
		{
			this.targetName = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg1, "");
			if (!UtageToolKit.TryParaseEnum<TargetType>(this.targetName, out this.targetType))
			{
				this.targetType = TargetType.Default;
			}
			this.targetName = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg2, this.targetName);
			string defaultStr = " x=30 y=30";
			string arg = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg3, defaultStr);
			if (!arg.Contains("x=") && !arg.Contains("y="))
			{
				arg += defaultStr;
			}
			string easeType = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg4, "");
			string loopType = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg5, "");
			this.tweenData = new iTweenData(iTweenType.ShakePosition.ToString(), arg, easeType, loopType);

			this.waitType = AdvParser.ParseCellOptional<WaitType>(row, AdvColumnName.Arg6, WaitType.Wait);
			
			if (!string.IsNullOrEmpty(tweenData.ErrorMsg))
			{
				Debug.LogError(row.ToErrorString(tweenData.ErrorMsg));
			}
		}
		public AdvCommandSelectionClick(StringGridRow row, AdvSettingDataManager dataManager)
			: base(row)
		{
			this.jumpLabel = AdvCommandParser.ParseScenarioLabel(row, AdvColumnName.Arg1);
			string expStr = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg2, "");
			if( string.IsNullOrEmpty(expStr) )
			{
				this.exp = null;
			}
			else
			{
				this.exp = dataManager.DefaultParam.CreateExpressionBoolean(expStr);
				if (this.exp.ErrorMsg != null)
				{
					Debug.LogError(row.ToErrorString(this.exp.ErrorMsg));
				}
			}

			string selectedExpStr = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg3, "");
			if (string.IsNullOrEmpty(selectedExpStr))
			{
				this.selectedExp = null;
			}
			else
			{
				this.selectedExp = dataManager.DefaultParam.CreateExpression(selectedExpStr);
				if (this.selectedExp.ErrorMsg != null)
				{
					Debug.LogError(row.ToErrorString(this.selectedExp.ErrorMsg));
				}
			}

			this.name = AdvParser.ParseCell<string>(row, AdvColumnName.Arg4 );
			this.isPolygon = AdvParser.ParseCellOptional<bool>(row, AdvColumnName.Arg5, true );
		}
		internal AdvGraphicOperaitonArg(StringGridRow row, GraphicInfoList graphic, float fadeTime, bool isNoPtattern = false)
		{
			this.RowData = row;
			this.Graphic = graphic;
			this.FadeTime = fadeTime;
			this.IsNoPtattern = isNoPtattern;

			this.Arg2 = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg2, "");
			this.Arg3 = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg3, "");
			this.Arg4 = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg4, "");
			this.Arg5 = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg5, "");
			float x;
			if (float.TryParse(Arg4, out x))
			{
				this.X = x;
			}
			float y;
			if (float.TryParse(Arg5, out y))
			{
				this.Y = y;
			}
			else
			{
				MotionPlayType type;
				if (UtageToolKit.TryParaseEnum<MotionPlayType>(Arg5, out type))
				{
					PlayType = type;
				}
			}
		}
		public AdvCommandCharacterOff(StringGridRow row)
			: base(row)
		{
			this.name = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg1, "");
			//フェード時間
			this.fadeTime = AdvParser.ParseCellOptional<float>(row, AdvColumnName.Arg6, 0.2f);
		}
Ejemplo n.º 5
0
		/// <summary>
		/// コンストラクタ
		/// </summary>
		/// <param name="jumpLabel">飛び先のラベル</param>
		/// <param name="text">表示テキスト</param>
		/// <param name="exp">選択時に実行する演算式</param>
		public AdvSelection(string jumpLabel, string text, ExpressionParser exp, StringGridRow row)
		{
			this.jumpLabel = jumpLabel;
			this.text = text;
			this.exp = exp;
			this.spriteName = "";
			this.row = row;
		}
Ejemplo n.º 6
0
		/// <summary>
		/// コンストラクタ
		/// </summary>
		/// <param name="label">ジャンプ先のラベル</param>
		/// <param name="spriteName">クリックを有効にするオブジェクト名</param>
		/// <param name="isPolygon">ポリゴンコライダーを使うか</param>
		/// <param name="exp">選択時に実行する演算式</param>
		public AdvSelection(string jumpLabel, string spriteName, bool isPolygon, ExpressionParser exp, StringGridRow row)
		{
			this.jumpLabel = jumpLabel;
			this.text = "";
			this.exp = exp;
			this.spriteName = spriteName;
			this.isPolygon = isPolygon;
			this.row = row;
		}
		public AdvCommandParam(StringGridRow row, AdvSettingDataManager dataManger)
			: base(row)
		{
			this.exp = dataManger.DefaultParam.CreateExpression(AdvParser.ParseCell<string>(row, AdvColumnName.Arg1));
			if (this.exp.ErrorMsg != null)
			{
				Debug.LogError(row.ToErrorString(this.exp.ErrorMsg));
			}
		}
Ejemplo n.º 8
0
		public AdvCommandSe(StringGridRow row, AdvSettingDataManager dataManager)
			: base(row)
		{
			string label = AdvParser.ParseCell<string>(row, AdvColumnName.Arg1);
			if (!dataManager.SoundSetting.Contains(label, SoundType.Se))
			{
				Debug.LogError(row.ToErrorString(label + " is not contained in file setting"));
			}

			this.file = AddLoadFile(dataManager.SoundSetting.LabelToFilePath(label, SoundType.Se));
		}
		public AdvCommandBgEvent(StringGridRow row, AdvSettingDataManager dataManager)
			: base(row)
		{
			this.label = AdvParser.ParseCell<string>(row, AdvColumnName.Arg1);
			if (!dataManager.TextureSetting.ContainsLabel(label))
			{
				Debug.LogError(row.ToErrorString(label + " is not contained in file setting"));
			}

			this.graphic = dataManager.TextureSetting.LabelToGraphic(label);
			AddLoadGraphic(graphic);
			this.graphicOperaitonArg = new AdvGraphicOperaitonArg(row, graphic, AdvParser.ParseCellOptional<float>(row, AdvColumnName.Arg6, 0.2f) );
		}
		public AdvCommandSendMessage(StringGridRow row)
			: base(row)
		{
			this.name = AdvParser.ParseCell<string>(row, AdvColumnName.Arg1);
			this.arg2 = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg2, "");
			this.arg3 = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg3, "");
			this.arg4 = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg4, "");
			this.arg5 = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg5, "");

			this.text = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Text, "");
			this.voice = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Voice, "");
			this.voiceVersion = AdvParser.ParseCellOptional<int>(row, AdvColumnName.VoiceVersion, 0);
		}
Ejemplo n.º 11
0
		void Create(string name, CsvType type, string csvText, int headerRow )
		{
			this.name = name;
			this.type = type;
			Rows.Clear();
			//CSVデータを作成
			string[] lines = csvText.Split("\n"[0]);
			for (int i = 0; i < lines.Length; i++)
			{
				StringGridRow row = new StringGridRow(GetThis, Rows.Count);
				row.InitFromCsvText(type,lines[i]);
				Rows.Add(row);
			}
			ParseHeader(headerRow);
			textLength = csvText.Length;
		}
Ejemplo n.º 12
0
		public AdvCommandJump(StringGridRow row, AdvSettingDataManager dataManager)
			: base(row)
		{
			this.jumpLabel = AdvCommandParser.ParseScenarioLabel(row, AdvColumnName.Arg1);
			string expStr = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg2, "");
			if (string.IsNullOrEmpty(expStr))
			{
				this.exp = null;
			}
			else
			{
				this.exp = dataManager.DefaultParam.CreateExpressionBoolean(expStr);
				if (this.exp.ErrorMsg != null)
				{
					Debug.LogError(row.ToErrorString(this.exp.ErrorMsg));
				}
			}
		}
		public AdvEffectDataTween(StringGridRow row)
		{
			this.targetName = AdvParser.ParseCell<string>(row, AdvColumnName.Arg1);
			this.targetType = TargetType.Default;

			string type = AdvParser.ParseCell<string>(row, AdvColumnName.Arg2);
			string arg = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg3, "");
			string easeType = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg4, "");
			string loopType = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg5, "");
			this.waitType = AdvParser.ParseCellOptional<WaitType>(row, AdvColumnName.Arg6, WaitType.Wait);

			this.tweenData = new iTweenData(type, arg, easeType, loopType);
			if (this.tweenData.Type == iTweenType.Stop)
			{
				waitType = WaitType.Add;
			}

			if (!string.IsNullOrEmpty(tweenData.ErrorMsg))
			{
				Debug.LogError(row.ToErrorString(tweenData.ErrorMsg));
			}
		}
		public AdvCommandSprite(StringGridRow row, AdvSettingDataManager dataManager)
			: base(row)
		{
			this.spriteName = AdvParser.ParseCell<string>(row, AdvColumnName.Arg1);
			string fileName = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg2, spriteName);

			if (!dataManager.TextureSetting.ContainsLabel(fileName))
			{
				Debug.LogError(row.ToErrorString(fileName + " is not contained in file setting"));
			}

			this.graphic = dataManager.TextureSetting.LabelToGraphic(fileName);
			AddLoadGraphic(graphic);
			this.layerName = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg3, "");
			if (!string.IsNullOrEmpty(layerName) && !dataManager.LayerSetting.Contains(layerName, AdvLayerSettingData.LayerType.Sprite))
			{
				Debug.LogError(row.ToErrorString( layerName + " is not contained in layer setting"));
			}

			//グラフィック表示処理を作成
			this.graphicOperaitonArg =  new AdvGraphicOperaitonArg(row, graphic, AdvParser.ParseCellOptional<float>(row, AdvColumnName.Arg6, 0.2f) );
		}
		/// <summary>
		/// コマンド生成
		/// </summary>
		/// <param name="row">行データ</param>
		/// <param name="dataManager">データマネージャー</param>
		/// <returns>生成されたコマンド</returns>
		static public AdvCommand CreateCommand(StringGridRow row, AdvSettingDataManager dataManager)
		{
			if (IsComment(row))
			{
				//コメント
				return null;
			}
			AdvCommand command = null;
			///独自のコマンド解析処理があるならそっちを先に
//			if (CallBackCreateCustomCommnad != null) command = CallBackCreateCustomCommnad(row, dataManager);

			///基本のコマンド解析処理
			if (command == null) command = CreateCommandDefault(row, dataManager);


			if (command == null)
			{
				//記述ミス
				Debug.LogError(row.ToErrorString(LanguageAdvErrorMsg.LocalizeTextFormat(AdvErrorMsg.CommnadParseNull)));
			}

			return command;
		}
Ejemplo n.º 16
0
		public GraphicInfo(StringGridRow row)
		{
			this.fileName = AdvParser.ParseCell<string>(row, AdvColumnName.FileName);
			try
			{
				this.pivot = ParserUtil.ParsePivotOptional(AdvParser.ParseCellOptional<string>(row, AdvColumnName.Pivot, ""), pivot);
			}
			catch (System.Exception e)
			{
				Debug.LogError(row.ToErrorString(e.Message));
			}

			try
			{
				this.scale = ParserUtil.ParseScale2DOptional(AdvParser.ParseCellOptional<string>(row, AdvColumnName.Scale, ""), this.scale);
			}
			catch (System.Exception e)
			{
				Debug.LogError(row.ToErrorString(e.Message));
			}
			this.CondionalExpression = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Conditional, "");
			this.version = AdvParser.ParseCellOptional<int>(row, AdvColumnName.Version, 0);
			this.IgnoreLoad = AdvParser.ParseCellOptional<bool>(row, AdvColumnName.IgnoreLoad, false);
		}
Ejemplo n.º 17
0
		public AdvCommandText(StringGridRow row, AdvSettingDataManager dataManager)
			: base(row)
		{
			//ページコントローラー
			this.pageCtrlType = AdvParser.ParseCellOptional<AdvPageController.Type>(row, AdvColumnName.PageCtrl, AdvPageController.Type.None );
			dataManager.PageContoroller.Update(this.pageCtrlType);

			//メッセージウィンドウのタイプ
			this.windowType = AdvParser.ParseCellOptional<string>(row, AdvColumnName.WindowType, "");
			
			this.text = AdvParser.ParseCell<string>(row, AdvColumnName.Text);
			if (AdvCommand.IsEditorErrorCheck)
			{
				TextData textData = new TextData(text);
				if (!string.IsNullOrEmpty(textData.ErrorMsg))
				{
					Debug.LogError(row.ToErrorString(textData.ErrorMsg));
				}
			}
			
			//ページの末端かチェック
			//ページコントローラーでテキストを表示しつづける場合は、ページ末端じゃない
			this.isPageEnd = (text.Length > 0) && !dataManager.PageContoroller.IsKeepText;
		}
		// シナリオラベルを解析
		static public string ParseScenarioLabel(StringGridRow row, AdvColumnName columnName)
		{
			string label = AdvParser.ParseCell<string>(row, columnName);
			if (!IsScenarioLabel(label))
			{
				Debug.LogError(row.ToErrorString(LanguageAdvErrorMsg.LocalizeTextFormat(AdvErrorMsg.NotScenarioLabel, label)));
			}
			return label.Substring(1);
		}
		/// <summary>
		/// コマンド名なしの場合のコマンドIDを取得
		/// </summary>
		/// <param name="row">行データ</param>
		/// <param name="dataManager">データマネージャー</param>
		/// <returns>生成するコマンドID</returns>
		static string ParseCommandID(StringGridRow row)
		{
			string id = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Command, "");
			if (id == "")
			{
				//コマンドなしは、テキスト表示が基本
				string arg1 = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Arg1, "");
				if (!string.IsNullOrEmpty(arg1))
				{
					//パラメーターつきなので、キャラ表示
					return IdCharacter;
				}
				string text = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Text, "");
				if (text.Length > 0)
				{
					//地の文
					return IdText;
				}
				else
				{	//なにもないので空データ
					return null;
				}
			}
			else if (IsScenarioLabel(id))
			{
				//シナリオラベル
				id = IdScenarioLabel;
			}
			return id;
		}
		/// <summary>
		/// 基本のコマンド生成処理
		/// </summary>
		/// <param name="id">コマンドID</param>
		/// <param name="dataManager">データマネージャー</param>
		/// <returns>生成されたコマンド</returns>
		static public AdvCommand CreateCommandDefault(string id, StringGridRow row, AdvSettingDataManager dataManager)
		{
			switch (id)
			{
				case IdCharacter:
					return new AdvCommandCharacter(row,dataManager);
				case IdText:
					return new AdvCommandText(row, dataManager);
				case IdCharacterOff:
					return new AdvCommandCharacterOff(row);
				case IdBg:
					return new AdvCommandBg(row, dataManager);
				case IdBgOff:
					return new AdvCommandBgOff(row);
				case IdBgEvent:
					return new AdvCommandBgEvent(row, dataManager);
				case IdBgEventOff:
					return new AdvCommandBgEventOff(row);
				case IdSprite:
					return new AdvCommandSprite(row, dataManager);
				case IdSpriteOff:
					return new AdvCommandSpriteOff(row);
				case IdMovie:
					return new AdvCommandMovie(row, dataManager);

				case IdTween:
					return new AdvCommandTween(row, dataManager);
				case IdFadeIn:
					return new AdvCommandFadeIn(row);
				case IdFadeOut:
					return new AdvCommandFadeOut(row);
				case IdShake:
					return new AdvCommandShake(row, dataManager);


				case IdSe:
					return new AdvCommandSe(row, dataManager);
				case IdBgm:
					return new AdvCommandBgm(row, dataManager);
				case IdStopBgm:
					return new AdvCommandStopBgm(row);
				case IdAmbience:
					return new AdvCommandAmbience(row, dataManager);
				case IdStopAmbience:
					return new AdvCommandStopAmbience(row);
				case IdStopSound:
					return new AdvCommandStopSound(row);

				case IdWait:
					return new AdvCommandWait(row);

				case IdParam:
					return new AdvCommandParam(row, dataManager);
				case IdSelection:
					return new AdvCommandSelection(row, dataManager);
				case IdSelectionClick:
					return new AdvCommandSelectionClick(row, dataManager);
				case IdJump:
					return new AdvCommandJump(row, dataManager);
				case IdJumpRandom:
					return new AdvCommandJumpRandom(row, dataManager);
				case IdIf:
					return new AdvCommandIf(row, dataManager);
				case IdElseIf:
					return new AdvCommandElseIf(row, dataManager);
				case IdElse:
					return new AdvCommandElse(row);
				case IdEndIf:
					return new AdvCommandEndIf(row);

				case IdSendMessage:
					return new AdvCommandSendMessage(row);
				case IdEndScenario:
					return new AdvCommandEndScenario(row);
				case IdEndSceneGallery:
					return new AdvCommandEndSceneGallery(row);

				case IdPageControler:
					return new AdvCommandPageControler(row,dataManager);
				case IdScenarioLabel:
					return new AdvCommandScenarioLabel(row);
				default:
					return null;
			}
		}
		public const string IdPageControler = "PageControl";		//ページの制御


		/// <summary>
		/// 基本のコマンド生成処理
		/// </summary>
		/// <param name="row">行データ</param>
		/// <param name="dataManager">データマネージャー</param>
		/// <returns>生成されたコマンド</returns>
		static public AdvCommand CreateCommandDefault( StringGridRow row, AdvSettingDataManager dataManager)
		{
			string id = ParseCommandID(row);
			AdvCommand command = null;
			///独自のコマンド生成処理があるならそっちを先に
//			if (CallBackCreateCustomCommnadFromID != null) command = CallBackCreateCustomCommnadFromID(id, row, dataManager);

			///独自のコマンド解析処理があるならそっちを先に
			if (command == null && OnCreateCustomCommnadFromID != null ) OnCreateCustomCommnadFromID(id, row, dataManager, ref command);

			///基本のコマンド解析処理
			if (command == null) command = CreateCommandDefault(id, row, dataManager);
			return command;
		}
		public AdvCommandStopSound(StringGridRow row)
			:base(row)
		{
			this.fadeTime = AdvParser.ParseCellOptional<float>(row, AdvColumnName.Arg6, fadeTime);
		}
Ejemplo n.º 23
0
 public AdvCommandEndIf(StringGridRow row)
     : base(row)
 {
 }
Ejemplo n.º 24
0
 public AdvCommandBgEventOff(StringGridRow row)
     : base(row)
 {
 }
Ejemplo n.º 25
0
 public AdvCommandBgEventOff(StringGridRow row)
 {
     this.fadeTime = AdvParser.ParseCellOptional <float>(row, AdvColumnName.Arg6, 0.2f);
 }
		public AdvCommandMovie(StringGridRow row, AdvSettingDataManager dataManager)
			: base(row)
		{
			this.label = AdvParser.ParseCell<string>(row, AdvColumnName.Arg1);
		}
Ejemplo n.º 27
0
 public AdvCommandHideMenuButton(StringGridRow row)
     : base(row)
 {
 }
Ejemplo n.º 28
0
 public AdvCommandEndScenario(StringGridRow row)
     : base(row)
 {
 }
Ejemplo n.º 29
0
 public AdvCommandStopBgm(StringGridRow row)
     : base(row)
 {
     this.fadeTime = ParseCellOptional <float>(AdvColumnName.Arg6, 0.2f);
 }
		//コメントのコマンドかチェック
		static bool IsComment(StringGridRow row)
		{
			string command = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Command, "");
			if( string.IsNullOrEmpty(command) )
			{
				return false;
			}
			else if (command == IdComment)
			{
				return true;
			}
			else if (command.Length >= 2 && command.Substring(0, 2) == "//")
			{
				return true;
			}
			else
			{
				return false;
			}
		}
Ejemplo n.º 31
0
		void AddUrltList(List<AssetFilePathInfo> urlList, StringGridRow row, string csvDir)
		{
			string path = AdvParser.ParseCell<string>(row, AdvColumnName.Param1);
			int version = AdvParser.ParseCell<int>(row, AdvColumnName.Version);
			urlList.Add( new AssetFilePathInfo( FileNameToPath(path, csvDir), version));
		}
		public AdvCommandSelectionEnd(StringGridRow row, AdvSettingDataManager dataManager)
			: base(row)
		{
			dataManager.PageContoroller.Clear();
		}
 public AdvCommandHideMessageWindow(StringGridRow row)
     : base(row)
 {
 }
Ejemplo n.º 34
0
		void ParseFromCsvStringGridRow(StringGridRow row, string csvDir)
		{
			string tag = AdvParser.ParseCell<string>(row, AdvColumnName.Tag);
			switch (tag)
			{
				case TagScenarioSetting:
					AddUrltList(ScenarioSettingUrlList, row, csvDir);
					break;
				case TagCharacterSetting:
					AddUrltList(CharacterSettingUrlList, row, csvDir);
					break;
				case TagTextureSetting:
					AddUrltList(TextureSettingUrlList, row, csvDir);
					break;
				case TagSoundSetting:
					AddUrltList(SoundSettingUrlList, row, csvDir);
					break;
				case TagParamSetting:
					AddUrltList(ParamSettingUrlList, row, csvDir);
					break;
				case TagLayerSetting:
					AddUrltList(LayerSettingUrlList, row, csvDir);
					break;
				case TagSceneGallerySetting:
					AddUrltList(SceneGallerySettingUrlList, row, csvDir);
					break;
				default:
					Debug.LogError(LanguageAdvErrorMsg.LocalizeTextFormat(AdvErrorMsg.UnknownTag,tag));
					break;
			}
		}
		public AdvCommandEndIf(StringGridRow row)
			: base(row)
		{
		}
		public AdvCommandFadeIn(StringGridRow row)
			: base(row)
		{
			this.color = AdvParser.ParseCellOptional<Color>(row, AdvColumnName.Arg1, Color.white);
			this.time = AdvParser.ParseCellOptional<float>(row, AdvColumnName.Arg6, 0.2f);
		}
		public AdvCommandPageControler(StringGridRow row, AdvSettingDataManager dataManager)
			: base(row)
		{
//			dataManager.PageContoroller.IsKeepText = true;
		}