Forum Discussion
molton
11 years agoExplorer
I need help activatting a javascript component from c#
Hello, I can't seem to figure this out, I was hoping somebody here knows of a good solution for this. I have javascript image effects attached to the CameraRight and CameraLeft GameObjects but I real...
Curtis
11 years agoExplorer
Typically, you would just move the C# to a suitable place in regards to script compilation order.
http://docs.unity3d.com/Manual/ScriptCompileOrderFolders.html
But if that isn't suitable for what you are trying to do, you can create a couple of "dummy" scripts. For instance you have your main C# script, create another C# script in the standard assets folder and attach it to the same gameObject as your main C# script. Create variables in the new C# script for the stuff you want to pass to java. Now in your original script, where you were trying to pass to java pass to the new script.
Then create a javascript, attach it to your camera, and you should be able to access variables from the dummy script you put in standard assets, as well as the image effect script.
Hope that helps
http://docs.unity3d.com/Manual/ScriptCompileOrderFolders.html
But if that isn't suitable for what you are trying to do, you can create a couple of "dummy" scripts. For instance you have your main C# script, create another C# script in the standard assets folder and attach it to the same gameObject as your main C# script. Create variables in the new C# script for the stuff you want to pass to java. Now in your original script, where you were trying to pass to java pass to the new script.
Then create a javascript, attach it to your camera, and you should be able to access variables from the dummy script you put in standard assets, as well as the image effect script.
Hope that helps
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device