Switch

The Switch node is used for identifying which connection to run based on the value.

The default connection will be executed if no condition is passed.

Examples

Flow Graph:

Generated Script:

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class test : MonoBehaviour {
  public int variable0 = 1;

  public void Start() {
    switch(variable0) {
      case 1: {
        Debug.Log("The result is 1");
      }
      break;
      case 2: {
        Debug.Log("The result is 2");
      }
      break;
    }
  }
}

 

Was this helpful to you?