Skip to content

User behaviour linking

Choose a tag to compare

@MerlinVR MerlinVR released this 20 Feb 23:24
· 1294 commits to master since this release
a0bee6a

This release has a bunch of fixes and allows you to access fields and methods on other UdonSharpBehaviours that you define. In order to use this, your behaviours must inherit from UdonSharpBehaviour. For instance this allows you to make a debug console in your world that uses a behaviour you have defined named DebugConsole that behaviour that has a method named Log(string logMessage) defined inside it. You can then store a reference to the DebugConsole on another behaviour and directly call it like debugConsoleRef.Log("Hello");

Features:

  • 0658ed8: Call methods on other behaviours directly
  • 17e36a2: Get and set fields on other behaviours directly
  • 17e36a2: Store references to other behaviours as references to the type the user defined.
  • a8e4ec9: Allow arrays of user-defined behaviour references
  • f7cde48 ec1f25c f87ea0f: Overridden UI to allow checking on component type and [HideInInspector] attribute. The UI uses unity-like naming on variables and has a more unity-like array editor. It also supports viewing and editing a wider range of builtin types.
  • afd0e8e: Add types that will be supported for syncing in an upcoming version of Udon to the sync type check whitelist
  • dfc003f: Add instantiate call to VRCInstantiate so that it can have its behaviour mirrored if you want to test without using Udon

Bug fixes

  • 0658ed8: Add type checking on typeof() so that users cannot get the type of a user defined type since it will only exist in the editor and will be null at runtime since VRC does not define the same type.
  • f7cde48: Now initialize array fields to a 0-length array like they usually are in Unity, reported by @synergiance
  • 45cb3b6: Fix infinite loop when using continue in foreach loops, reported by @orels1
  • 9bceab8 efdeb24: Switch UdonSharp to use assembly definition files and make the Roslyn compiler dlls editor-only and force them to be included explicitly. Hopefully this will resolve a rare bug where Unity decides that it can't compile anything and drops all asset references in your editor until you restart your editor.
  • ec1f25c: Fix issue with using [UdonSynced] without an attribute list, reported by @gg67
  • b238c44: Make all 'named' variables also unique based on their type. This was generating unnecessary garbage as the heap would need to create a new strongbox every time the type of the variable changed, reported by @TCL987