BlackStartx / VRC-Gesture-Manager

A tool that will help you preview and edit your VRChat avatar animation directly in Unity.
MIT License
290 stars 23 forks source link

Change classes to work outside of Editor #18

Open imagitama opened 1 year ago

imagitama commented 1 year ago

Issue

I want to use your awesome tool in a personal Unity app I am building for testing VRChat avatars. But I can't because almost all of the classes you wrote are in the Editor folder so aren't available in the built app.

Solution

Change classes that don't use the UnityEditor classes outside of the Editor folder so they can be used anywhere.

Testing

In my project I've already tried it for a bunch of classes and they all work as expected.

brandonvdongen commented 1 year ago

@imagitama Can't say for certain but it's something I've encountered a lot in my own scripts in that this is most likely because when you build an avatar if you have scripts that are not mono behaviors in the project on build time it causes the avatar build to fail. while unity will work fine with them not being in the editor context, actually building/uploading your avatar with them outside of the editor context will throw an error and cause the upload to fail.

BlackStartx commented 1 year ago

Hi~ :3 🌺 First off, I'm so sorry for not answering this right away, I wanted to make sure this was fine for the VRC team as well.

Anyway, reordering my classes to be more "runtime friendly" is fine... It's just that there will be a lot of changes and I will probably break dependency with other tools. (plus, I was not expecting a use outside the UnityEditor, so the whole tool was designed knotted with the editor ;^;)

And as for @brandonvdongen, yeah having Editor classes outside of Editor folders will give errors on builds, but I think what @imagitama is asking is to strip all the function that doesen't need the Editor in their own runtime scripts, if I've understood that correctly~

AraHaan commented 2 weeks ago

Can't they just implement some of the Unity Editor bits in their Unity Application as well so they could use this inside of their application if they wanted to?