teenageengineering / videolab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how can i use another script and compatible with video lab?

kanszerland opened this issue · comments

I tried to make another script in video lap unity project,Function of my script it work when it play on ios outside opz app, but doesn't work when i put in opz app.

You can't load other scripts to videolab, at least for now.

That's a Unity Asset Bundle limitation, scripts are not included in Asset Bundles at all. There is a way to dynamically load assemblies/scripts (https://docs.unity3d.com/550/Documentation/Manual/scriptsinassetbundles.html), but even that:

  1. TE has to implement a way in the current OP-Z app to load such assemblies (and give us the possibility to provide them somehow).
  2. Even then, it will not work on iOS, as it's not allowed by Apple to load assemblies on runtime which are not part of the published appstore app.

We are out of luck there.

@georgechond94 Thanks for this explanation, but I’m new to all this stuff and it’s a bit confusing to me. If scripts are not included in Asset Bundles at all, then how come the scripts included in videolab work on the op z app? I guess they are part of the app itself?

And the wiki says this: “Content exported for OP-Z can rely only on scripts included in videolab. If you want to add functionality to videolab feel free to fork the repo (see Contributing to videolab).”

To me this sounds like we can add our own scripts to videolab and get it to work on the op z if we fork the repo. Or would TE have to add the extra functionality of one’s fork to their app for it to work?

Then how come the scripts included in videolab work on the op z app? I guess they are part of the app itself?

Exactly, the videolab "folder" (which contains the scripts) is already part of the op-z app itself. That's why we can use these scripts freely. Our own scripts are not part of the op-z app itself, and Asset Bundles don't include them, so in the exported videopak/asset bundle, our scripts do nothing.

Or would TE have to add the extra functionality of one’s fork to their app for it to work?

Yep, that's exactly what they mean, one has to add functionality to the videlab itself, TE has to include that into the op-z app and then we will be able to use that additional script.

I know it's a bummer, if writing our own scripts was supported, the possibilities would be endless.

This would be SO good to have.. Imagine being able to pull live data from a website and have it displayed live, or use the iOS/Android device's microphone input to drive some aspect of the videopak.

For now, the only workaround I have is building the Unity Application as an iOS app, and loading on to the device (which works!), but I'd rather have the app as a .zpak that can be shared easily with the OP-Z App!