Page 1 of 1

Accessing Amplify Color C# variables from Javascript

PostPosted: Thu Apr 30, 2015 4:58 pm
by castor
First of all, congrats on the great plugin, love it!

For my current project I need to add AmplifyColorEffect components through scripts and assign custom LUTs.
My problem is that since I'm writing code in UnityScript, I can't access any of the variables for the plugin.

What I'm doing now is placing the Amplify Color package inside Standard Assets so it works BUT when I make a build I'm getting errors due to the Editor folder rule:

An Editor folder which is not located in another special folder can be placed/nested anywhere in the project. However, if it’s in Standard Assets, Pro Standard Assets, or Plugins, it must be a direct child of these folders.


So I've copied the contents of the Amplify Color plugin folder inside the Standard Assets/Editor folder and it works fine.
I'm just wondering. Is there a cleaner way to deal with this? Maybe I'm doing it wrong?

Re: Accessing Amplify Color C# variables from Javascript

PostPosted: Sat May 02, 2015 1:56 pm
by Diogo Teixeira
Hi castor,

castor wrote:First of all, congrats on the great plugin, love it!


Thank you. Highly appreciated!

Great that you found it useful. We're already working to make it 10x better in v2. Your feedback is very important to us.

castor wrote:For my current project I need to add AmplifyColorEffect components through scripts and assign custom LUTs. My problem is that since I'm writing code in UnityScript, I can't access any of the variables for the plugin.


I might be able to get this sorted out. Let me get back to you on this.

What I'm doing now is placing the Amplify Color package inside Standard Assets so it works BUT when I make a build I'm getting errors due to the Editor folder rule:

An Editor folder which is not located in another special folder can be placed/nested anywhere in the project. However, if it’s in Standard Assets, Pro Standard Assets, or Plugins, it must be a direct child of these folders.

So I've copied the contents of the Amplify Color plugin folder inside the Standard Assets/Editor folder and it works fine.
I'm just wondering. Is there a cleaner way to deal with this? Maybe I'm doing it wrong?


You should only need to copy the entire AmplifyColor folder as is (e.g. Assets/SomeFolder/AmplifyColor). I tend to do this in my projects as well, where we have a ThirdParty folder, or similar, and keep all the plugins we use in there. All our plugins support moving the base folder to anywhere else in the project.

Maybe Unity is applying different rules in what is essentially their "Standard" folders? I would suggest having your own folder for third-party, non-Unity plugins.

Re: Accessing Amplify Color C# variables from Javascript

PostPosted: Sat May 02, 2015 2:27 pm
by Diogo Teixeira
Took me a while to realize that you were probably not moving the AC folder for mere organizational purposes.

So, based on this:
A common example is where a UnityScript file needs to reference a class defined in a C# file. You can achieve this by placing the <b>C# file inside a Plugins folder</b> and the UnityScript file in a non-special folder. If you don’t do this, you will get an error saying the C# class cannot be found. Source: Unity Manual


In theory, you should be able to access the AmplifyColorEffect component from UnityScript because we've placed our scripts in "AmplifyColor/Plugins". In practice, however, this doesn't seem to be the case..

Placing AmplifyColor in THE "Assets/Plugins" folder seems to work, however, even though the manual seems to suggest that it should work right off the bat with our default folder structure.