/// <summary> /// Makes the blocks in the flowchart pick up where they left off, when the original /// FlowchartData was made. /// </summary> protected virtual void LoadExecutingBlocks(FlowchartData data, Flowchart flowchart) { flowchart.StopAllBlocks(); for (int i = 0; i < data.Blocks.Count; i++) { var savedBlock = data.Blocks[i]; if (!savedBlock.WasExecuting) { continue; } var fullBlockObj = flowchart.FindBlock(savedBlock.BlockName); if (fullBlockObj == null) { // Seems the user removed the block. Might as well let them know. var messageFormat = @"Could not load state of block named {0} from flowchart named {1}; the former is not in the latter."; var message = string.Format(messageFormat, savedBlock.BlockName, flowchart.name); Debug.LogWarning(message); continue; } flowchart.ExecuteBlock(fullBlockObj, savedBlock.CommandIndex); } }
/// <summary> /// スキップボタン押下時 /// </summary> public void PushSkipButton() { // スキップボタン無効化 skipButton.SetActive(false); // 現在のブロックを停止する flowchart.StopAllBlocks(); // 再生中のイベントに応じてスキップ先を選択 switch (loadEventParam) { case GameUtil.Const.FUNGUS_KEY_EVENT_EPISODE1_END: case GameUtil.Const.FUNGUS_KEY_EVENT_EPISODE2_END: case GameUtil.Const.FUNGUS_KEY_EVENT_EPISODE2_END_2: case GameUtil.Const.FUNGUS_KEY_EVENT_EPISODE3_END: case GameUtil.Const.FUNGUS_KEY_EVENT_EPISODE4_END: // コンティニューイベント呼び出し flowchart.ExecuteBlock(GameUtil.Const.FUNGUS_CONTINUE_BLOCK); break; case GameUtil.Const.FUNGUS_KEY_EVENT_EPISODE5_END: default: // 会話終了 flowchart.ExecuteBlock(GameUtil.Const.FUNGUS_END_BLOCK); break; } }
private void OnEnable() { if (flowchart != null) { flowchart.gameObject.SetActive(false); flowchart.StopAllBlocks(); flowchart.Reset(true, true); } }
private void StopAllBlock() { if (flowchart == null) { return; } flowchart.StopAllBlocks(); flowchart.ExecuteBlock("GameOver"); }
public void HandleContinue(Command sayCommand, BaseContinue bc) { string nextBlock = flowChart.GetStringVariable("NextBlock"); if (!"Empty".Equals(nextBlock)) { flowChart.StopAllBlocks(); flowChart.ExecuteBlock(nextBlock); flowChart.SetStringVariable("NextBlock", "Empty"); if (flowChart.GetStringVariable("ConvoStage").Equals("MidConvo")) { flowChart.SetBooleanVariable("BadTransition", true); } else if (flowChart.GetStringVariable("ConvoStage").Equals("ConfessionApproach")) { // good transition flowChart.SetStringVariable("ConvoStage", "MidConvo"); flowChart.SetIntegerVariable("CommandIndex", 0); flowChart.SetStringVariable("CurrentBlock", nextBlock); TopicManager.instance.RegisterTopic(nextBlock); TopicManager.instance.ClearTopicRoll(); TopicManager.instance.ActivateTopicRoll(); } } else { if (flowChart.GetBooleanVariable("BadTransition")) { flowChart.StopAllBlocks(); flowChart.ExecuteBlock("AbruptTopicChange"); flowChart.SetBooleanVariable("BadTransition", false); } else { if (!sayCommand.ParentBlock.BlockName.Equals("AbruptTopicChange")) { // Normal flow flowChart.SetIntegerVariable("CommandIndex", (sayCommand.CommandIndex + 1)); } bc(); } } }
private void OnTriggerExit2D(Collider2D other) { if (other.tag == "StairsPrompt") { flow.StopAllBlocks(); flow.ExecuteBlock("Go To Stairs"); } if (other.tag == "Computer") { flow.StopAllBlocks(); flow.StopBlock("Menu Options"); } if (other.tag == "Files") { flow.StopAllBlocks(); flow.StopBlock("Menu Options"); } if (other.tag == "Stairs") { flow.StopAllBlocks(); flow.StopBlock("Menu Options"); } }
public void ExecuteStorytellingBlock(string blockName) { flowchart.StopAllBlocks(); flowchart.ExecuteBlock(blockName); }
public static void StartBlock(string blockName) { FC.StopAllBlocks(); FC.ExecuteBlock(blockName); }
public void StopBlocks() { flow.StopAllBlocks(); }