Editor Scripting Update
You will need to delete your old Assets/UdonSharp
directory before installing this to prevent compile errors when upgrading
Also make sure you have the latest VRCSDK installed
Use the openbeta package with the open beta SDK only
v0.18.0 adds an editor scripting API that allows the creation of custom inspectors for UdonSharpBehaviours and editor scripts for automating setup of complex prefabs. This update also brings many other bug fixes and improvements.
Features:
-
An editor scripting API that mirrors changes to UdonBehaviours to a C# version of the behaviour. See the wiki page on Editor Scripting to learn more about how to use it. This also allows you to use Unity's Handles API and gizmos:
-
Adds a runtime log watcher which forwards logs from in-game to the editor log, this can be enabled in the Udon Sharp settings menu. You can either forward all logs, or forward logs with only a specified prefix. The client that the log message came from will have the account name logged. Names are colored to differentiate between different clients in local testing.
-
The default inspector now takes a much smaller footprint. The Compile All UdonSharp Programs button has been moved to the Utilities dropdown. And program asset specific interface elements such as the assembly viewer and Export to Assembly Asset buttons have been moved to the program asset inspector.
-
Conditional compilation based on project preprocessor symbols now works. This also means you can check for
UNITY_EDITOR
to determine if this is a client build or editor build. #33 -
Optimize the compiler more, now ~20% faster in some cases
-
Handling for more variable types in the default inspector have been added for
uint
,long
,byte
,sbyte
,short
,ushort
,char
, andVRCUrl
-
Debug info and generated uasm are now stored in the Library as cache files. This prevents UdonSharpProgramAssets from being modified in most cases which prevents unneeded changes on version control commits.
-
File contents are now hashed and compiles only take place if a source file has changed or if you click the compile all programs button.
-
Automatically converts properties on UdonSharpBehaviours when converting from the C# version of a script to the UdonBehaviour version
-
Field initializers on jagged arrays are now supported
Fixes:
-
U# compiles are now triggered when you import an UdonSharpProgramAsset. This means that you don't need to tell U# to compile scripts after importing prefabs now. #51
-
Fix cases where serialized variables on behaviours would go out of date if their type changed or if they were removed. This caused a lot of strange issues for people. Variables will now attempt to convert type, and if they fail to convert they will be set to the default value. This will also make sure all UdonBehaviours assigned to UdonSharpBehaviour fields are of the correct types.
-
Make the binding phase give a proper line number when an error occurs instead of always saying the error is on line 1 of a file.
-
Add explicit errors about attempts to use static using statements or namespace aliases
-
Fix editor behaviour exceptions not getting logged with line number if client exception watching is disabled
-
Add error message for when runtime exception watching is enabled, but
--enable-udon-debug-logging
is not enabled. -
Fix ternery operator not propagating user types properly
-
Fix Set/GetProgramVariable calls on the current behaviour needing this.GetProgramVariable to work
-
Fix debug line offset being incorrect in switch statements
-
New scripts created via the create U# script UI are now encoded in UTF8 by default since some editors do not convert the file type which was causing encoding issues with Japanese text
-
Make inspector UI refresh immediately after compile to show modified fields
-
Make inspector UI always refresh in play mode to keep up to date with runtime field changes