Documentation version: 0.3.9 · Package guide
Runnable UdonSharp behaviours for the LCGUdonSharp 0.3.x feature set. Open TestLCGUdonSharp.unity to get a scene with the networking showcases wired up, or add any example component to a GameObject in your own scene.
| Folder | Feature | Scripts | Guide |
|---|---|---|---|
Networking/ |
Manual packet networking + LCGNetworkZone |
LCGPacketFieldShowcase, LCGPacketMethodShowcase, LCGZoneObjectShowcase |
Networking guide |
Interfaces/ |
C# interfaces on UdonSharpBehaviour |
InterfaceExampleRunner, AddNumberOperation, MultiplyNumberOperation |
Interfaces guide |
AsyncAwait/ |
Build-time async/await lowering |
AsyncYieldDelayExample, AsyncStringDownloadExample, AsyncImageDownloadExample, AsyncVideoLoadExample, AsyncVideoEndExample, AsyncGpuReadbackExample, AsyncSerializationExample, AsyncAvailableProductsExample, AsyncPurchasesExample, AsyncProductOwnersExample |
Async/await guide |
ExtendedLanguage/ |
ref/out, closed generics, LINQ closures, dynamic, Span<T>, try/catch |
RefOutExample, GenericHierarchyExample, LinqClosureExample, DynamicExample, SpanExample, ExceptionHandlingExample |
Extended language guide |
GenericRestrictions/ |
Normal C# collections plus rejected generic/hierarchy shapes | OpenGenericsExample, GenericBehavioursExample, GenericHeapObjectsExample, ListTypesExample, InterfaceMembersExample, MultipleConcreteBasesExample |
Collections and restrictions guide |
Root-level files:
The ScriptableObject shop and equipment examples
demonstrate typed data reads, nested economy assets, weapon/spell polymorphism,
checked casts and local purchases. Both wired prefabs are included in
TestLCGUdonSharp.unity.
| File | What it is |
|---|---|
TestLCGUdonSharp.unity |
Demo scene with the showcases ready to run. |
LogicCuteGuy.LCGUdonSharp.Examples.asmdef |
Unity assembly definition that compiles every example script into one assembly. |
LogicCuteGuy.LCGUdonSharp.Examples.USharp.asset |
UdonSharpAssemblyDefinition registration pointing sourceAssembly at the asmdef above. This is what makes the whole folder visible to the UdonSharp compiler. |
Two unrelated asset types sit next to the scripts. Mixing them up is the most common setup mistake (full definitions in the root README's Key terms):
- Program assets (
UdonSharpProgramAsset) — one per script, same basename:RefOutExample.cs↔RefOutExample.asset. The.assetlinkssourceCsScriptto the.csand stores the compiled Udon program. Only Assets > Create > U# Script creates the pair together; a.cswritten straight to disk has no program asset and shows "The associated script cannot be loaded". Every example script here already ships with its program asset. - Assembly registration (
UdonSharpAssemblyDefinition) — one per.asmdef, and its name does not matter (this package uses the*.USharp.assetsuffix). It only holds asourceAssemblyreference. The compiler always scansAssembly-CSharp; every other assembly must be registered like this or its behaviours are invisible to UdonSharp even though Unity compiles them fine.
- Fix any unrelated C# compilation errors and let Unity finish compiling.
- Open
TestLCGUdonSharp.unity, or add example components to GameObjects in your own scene and wire their serialized fields (each folder's README lists exactly what to assign). - Enter Play Mode and watch the Console. The networking examples need a second player (or a separate client/test build) to show remote behaviour, and the zone showcase needs an
LCGNetworkZonetrigger collider covering the play area.
- Copy the
.csand its same-named.assettogether, or recreate the script with Assets > Create > U# Script and paste the code in. - Scripts dropped under
Assets/without an.asmdefland inAssembly-CSharp, which UdonSharp scans automatically. - Scripts you move into your own
.asmdefneed that.asmdefregistered with Assets > Create > U# Assembly Definition (select the.asmdeffirst sosourceAssemblyis filled in). - The networking examples depend on the LCG runtime pieces (
LCGRuntime,LCGNetworkZone,LCGNetwork,LCGManualObjectSync) inUdonSharp/Runtime/LCGBehaviours/, themselves registered throughLogicCuteGuy.LCGUdonSharp.Runtime.USharp.asset.
- Root README: Features, Supported vs. Rejected, Troubleshooting.
- CHANGELOG for release history.