Hello, I am fine!
This article is an explanation of an improved version of the DarkClass introduced in the previous article.
(You do not need to read the previous article to understand this one.)
【VRChat】UdonSharpでユーザー定義クラスをNewする黒魔術【闇クラス】 - チカラの技術
It also explains how to handle generation tools that automatically generate DarkClass.
What is the DarkClass?
UdonSharp (U#) which is VRChat's world gimmick development language, it can't the creation of custom classes like regular C# due to limitations.
However, it is possible to create custom classes using a technical black magic called DarkClass.
var myDarkClass = MyDarkClass.New("Jane Doe", 23);
Improvements since last time

By changing type to be used from object to DataList, it is no longer necessary to write special instructions for arrays of DarkClass, making them much easier to handle.
In addition, changing the index value of an element from an int literal value to an enum type has made editing easier.
How to generate DarkClass
①Install the nuruwo repository list from the link below. (Do this with the VCC app closed.)
Install nuruwo's vpm repositories

② Import from VCC into your Unity project.

Select Tools -> Nuruwo -> DarkClassGenerator from the Unity menu.

③ Create a file for the DarkClasss
Create a new C# script (not a U# script) in Project. Name the file “MyDarkClass”.
(If generated as a U# script, delete the simultaneously generated Udon Sharp Program Asset)

④ DarkClass generation
Enter the required information in the generation tool as shown in the figure to generate it.

Click the “Generate DarkClass” button to copy the generated code to the clipboard and paste it over the script in ③.
This completes the creation of the DarkClass🎉
The generated results are as follows
続きを読む