Udon Graph Switch Case statement

Udon Graph Case statement

Unity: 2019.4.30f1
VRchat: VRCSDK3-WORLD-2021.09.03.09.25

Udon Graph does not contain a switch case statement, but you can easily build one using a branch statement. This mainly just duplicates the equivalent of a break statement. Here is an example:

switch (ChangeState)
{
    case 0: // Change to 1
          ChangeState = 1;
          break;
    case 1: // Change to 0
          ChangeState = 0;
          break;
}
Debug.Log("State: " + ChangeState );

Udon Graph Code:

application/vnd.unity.graphview.elements AO1a224bRxL9FWGe2URfqru6BPgltrMwNkgCONHLwhD6qnBDkwkvSQzFX5aHfNL+wtaQunJG9Kxjek1HkCFYHGmmps6pOqdq5j9//HnZ/BKm69Kc/uuyqevp9Ovwmn9ozsJiEuK0nL98s1yV11/M59MSZs2oWU8yH/YOY1E+ClszCNARRTCJhPEaakYK5AL/8k/z5WQ1mc+a08vmt+ZUGCIYO6ecVpIM2lHzpjk1YGEspSZNzqN9O2pm81y+f/FsyUE1fJbbf69GTZ3Of7069mr7m2dt/MvNDaxnk9Wbb+K/S1qdbe/qspnMlqswS+XFs+ZU8smXq8VkdnF1uGnejt7nz7ZZGb/cfDg6eb1M88V0EkcnZ2Wx5Bt+wnfUfo1Onq6nq/WiPJmV9WoRpqOTb9dxOkn/LG++m/9YZk8iYrDJOkUGivT0+9OwLM9/m6z+WmRXgH3Y0L4M02X5POM6BJKz+YyjetXG9XBlvZitjL6pK+fIpZKCAE9JAHKF+VCUMKaqVDCrCranrpRHHKPhKxt7U1co1diANEZLo/RjXf0QZhfl5SqsPlMKf6pxfbzSellW59fldVNS0VmtAS0XickCakzC+0oiVwoxsCL5kLslpZQcozYeHdm2ejYVJZw3bUlplESOFcx3iyrmhL66KtA4LmOTrfCRL+wDIQfvtTfuMCV3wHQPkvv3I8mny/lddj2dc0QP+KGBqO/2bRprdEobCa3z2XLMot3PsYMx5yDJ/G6x7snlFwuO5oeb9GnrQ3RteSbi9EnFmWM/KJBKzsUH4MM9NUo0Bu9vJW6bQPaTYyKyqNEakk7jTgYhVd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