Sahara's WebLog


Virt-A-Mate - Hello World - plugin basics 1 をやってみる。 - その2

Virt-A-Mate – Hello World – plugin basics 1 をやってみる。 – その1」の続き。
Hello World – plugin basics 1をやってみている。
今回はHello World – plugin basics 1からもらってきたスクリプトを眺めてみる。


Overview of the methods in the class…
Init – set the default values for properties we have defined
Start – just print a message to say the plugin is loaded
FixedUpdate – nothing yet
Update – each frame, check for changes and print a message when something changes (rather than continuous messages – every frame)


Side note: to know what ‘type’ you should use when creating a variable that references a UI component (such as a Slider or Button); Start typing the word ‘Create’ and observe the return type from intellisense.

Object BrowserのSearchに、例えばCreateとか入力すれば、ここで使っているCreateSliderのTypeなどを知ることができる。



Once the script is saved, drop the .cs file somewhere in Custom\Scripts\
Open VaM, load a scene, find the plugins window, (either scene plugin, session plugin or select an atom).
Click to add Plugin and choose your .cs file from the file explorer.
Click ‘Open Custom UI…’ to see the Button and Slider.
You should see changes to the counter variable or slider outputted in a message box.


If your plugin is RED and you see an error log – check the imports at the top of your script file against mine.


Also, be sure to check the .cs files from other author plugins (just unpack the var with 7-zip) for example code and inspiration.


For my first non-test plugin, I’ll be attempting to do something with VR controller positional metrics. If that works out ill reference to it here.
Update: click here for part 2 – November 2021:

Hope this helps someone – DM me with any inaccuracies because ill edit the guide.
Any questions or problems with the plugin/script or loading, comment here for other user benefit – they might have the same issues.


Posted under: Plugin


メールアドレスが公開されることはありません。 が付いている欄は必須項目です

Time limit is exhausted. Please reload CAPTCHA.