unity fungus シーンの移動

サブルーチンのような使い方

1:呼び出し元にFlow-->Callを追加
2:呼び出すブロックを指定する。(必要に応じてflowchartやlabelを設定する)
3:Callmodeに wait until finishedを指定する。

呼び出しブロックにStopBlockを設定しとくと、そこでそのブロック処理が止まり呼び出し元に戻る。

f:id:gamemaker98:20170501091844p:plain

f:id:gamemaker98:20170501091855p:plain


同様にcallmodeでcontinueを使うと変数計算等のマクロのような使い方ができそう?(要検証)
callmodeにstopだとそのまま終了するようだ。(Jumpとの違いがわからん)

 

 

 

 

//--fungusにload等のcommandがあったので不要。

using UnityEngine;
using System.Collections;
using Fungus;
using UnityEngine.SceneManagement;
using UnityEditor;
[CommandInfo("Command","reload scene","reload scene")]
public class LoadScene_funguscommand : Command {

// Use this for initialization
public override void OnEnter(){
// do
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex, LoadSceneMode.Single);
// Continue();

}
}

[CommandInfo("Command","load nextScene","next scene")]
public class nextScene_funguscommand : Command {

// Use this for initialization
public override void OnEnter(){
// do
SceneManager.LoadScene((SceneManager.GetActiveScene().buildIndex+1), LoadSceneMode.Single);
Continue();

}
}

[CommandInfo("Command","goto scenename","goto scene")]
public class gotoScene_funguscommand : Command {

public string sceneName;
// Use this for initialization
public override void OnEnter(){
// do
SceneManager.LoadScene(sceneName, LoadSceneMode.Single);
//SceneManager.LoadScene(sceneName);
// Continue();

}
}

 

//--------