This is sample collection of apps using VRM.
It is supposed to be built for WebGL by Unity.
This is a demo built with WebGL.
https://kilimanjaro-a2.github.io/SampleAppsOfVRM/
Download the project and open it in Unity Editor.
Then download the latest UniVRM unitypackage from https://github.com/vrm-c/UniVRM/releases and import it into your project.
The project uses Unity Editor version 2019.3.9f1, but you can use any version you like.
In the project, we have prepared 6 scenes that are expected to be used in apps using VRM.
The VRM used in the project is output from VRoid Studio.
- VRM loading does not work!
If the name of the GameObject specified as the call destination of the callback after opening the dialog is different, it will not work properly.
Make sure a GameObject with the name specified in FileImporterPlugin.jslib
exists in the scene and VRMLoadManager is attached to it.
In the sample project, the method named FileSelected ()
is called for all the scripts attached to the GameObject named "VRMLoader" in the scene.
- Why are you calling
FileImporterCaptureClick ()
on PointerDown of EventTrigger instead of OnClick of Button?
In FileImporterCaptureClick ()
, a handler for the Click event is generated and immediately fired.
If you do this when the Click fires, the event will not be handled until the next Click.
In order to avoid this phenomenon, the Pointer Down event, which is processed before the Click event, calls FileImporterCaptureClick ()
.
- I want to load VRM asynchronously
The WebGL build of Unity does not support multi-threading, so
VRMImporterContext.LoadAsync (
) doesn't seem to be usable.
Asynchronous loading can be supported by rewriting the script so that it does not use multithreading, but performance will be worse.
This project only supports synchronous loading.