サンプル
ドキュメントバージョン: 0.3.6
LCGUdonSharp リポジトリの Example/ には各機能の実行可能な scene と script があります。各 .cs には同じ名前の UdonSharpProgramAsset があり、example .asmdef には別の U# assembly-definition asset が含まれています。
| フォルダー | 内容 |
|---|---|
AsyncAwait | Yield、Delay、string/image/video、GPU readback、serialization、Creator Economy |
Interfaces | INumberOperation の Add/Multiply 実装 |
Networking | Native/LCG lamp、packet field/method、zone moving cube、任意実行の native/LCG high-bandwidth load generator |
GenericRestrictions | collection/JSON/binary と、拒否される generic/interface 形状 |
ExtendedLanguage | 例外、ref/out、generic、LINQ、dynamic、Span |
実行方法
- 他の C# compile error を解決します。
Example/TestLCGUdonSharp.unityを開くか、example component を scene に追加します。- Play Mode に入り Console を確認します。
0.3.6 の Networking prefab
NetworkExamples.prefabは zone 外の native synced lamp、zone 内の LCG packet lamp、LCG sync moving cube を配線済みです。2 client で再入場、late join、owner 退出、current-state snapshot を確認できます。HighBandwidthExamples.prefabは既定で停止している 2 つの load generator を含みます。NativeHighBandwidthExampleは Manual[UdonSynced] byte[]を送り、LCGHighBandwidthExampleは bounded motion queue で最大 32 個の converted object-sync cube を動かします。- LCG dashboard は local sample、local owned object、pending motion、dispatch batch、last batch size を表示します。診断値であり、remote delivery や network throughput の証明ではありません。
- タイ語の setup と 2-client checklistもあります。
Cross-client delivery、late join、ownership contention、bandwidth、FPS は複数 client の VRChat Build & Test で検証してください。1-player ClientSim で確認できるのは compile、配線、local interaction です。
:::tip 2 種類のアセット
各 U# .cs には同名の program asset が必要です。Assembly-CSharp 以外の .asmdef には U# assembly definition も必要です。それぞれ Assets > Create > U# Script と Assets > Create > U# Assembly Definition で作成できます。
:::