keijiro / KlakHap

HAP video player plugin for Unity
Other
341 stars 27 forks source link

Dynamic Add Component HapPlayer To Gameobject Show Error #9

Closed fingerx closed 5 years ago

fingerx commented 5 years ago

@keijiro this test code and error messages.

os:win10 unity:2018.3.6f1 plugin:v0.1.8

snipaste_2019-02-27_11-46-14

snipaste_2019-02-27_11-46-53

keijiro commented 5 years ago

This modification doesn't work; It's not enough to change the file path.

If you'd like to dynamically add a HapPlayer component, I recommend using the Open method as shown in the ScriptingTest.cs example. You can add the second argument to enable the LocalFileSystem mode.

var player = gameObject.AddComponent<HapPlayer>();
player.Open(fileName, HapPlayer.PathMode.LocalFileSystem );
keijiro commented 5 years ago

I'm closing this issue. Please feel free to reopen for further questions.

fingerx commented 5 years ago

@keijiro thanks