Hi.
I know this question is more related to c# but I've been slamming my head against the wall for a good amount of time by now, so I come here for some guidance.
I have a script called "Assets/Scripts/x.cs" that I want to use in a custom sequence command, which is in Plugins/Pixel Crushers/Dialogue System/Templates/SequencerCommandX.cs.
I'm trying to have a reference to my own script from the Sequencer command.
I tried using a namespace in my x.cs file and also using global namespace (:: operator) from the sequencer command but I can't see it.
What do I need to do this? By now the only thing that comes into my mind is copying my script to the Plugins folder, but I don't want to duplicate my files.
Any help is appreciated. Thanks
Reference a class from another folder
Re: Reference a class from another folder
Hi,
Move your SequencerCommandX.cs script out of the Plugins folder. For example, move it into the same folder as Assets/Scripts/x.cs.
Unity separately compiles scripts in Plugins first. Scripts in Plugins cannot access scripts that are outside of Plugins. However, scripts that are outside of Plugins can then reference the Plugins scripts that have already been compiled.
Move your SequencerCommandX.cs script out of the Plugins folder. For example, move it into the same folder as Assets/Scripts/x.cs.
Unity separately compiles scripts in Plugins first. Scripts in Plugins cannot access scripts that are outside of Plugins. However, scripts that are outside of Plugins can then reference the Plugins scripts that have already been compiled.
Re: Reference a class from another folder
That is interesting... didn't know that at all!
It's working, thanks a lot Tony
Now, out of curiousity, how come namespace "PixelCrushers.DialogueSystem" can be accesed outside Plugins? Did you have to reference the assemblies somewhere?
It's working, thanks a lot Tony
Now, out of curiousity, how come namespace "PixelCrushers.DialogueSystem" can be accesed outside Plugins? Did you have to reference the assemblies somewhere?
Re: Reference a class from another folder
Plugins is compiled first, without knowledge of things outside of Plugins.
Scripts outside of Plugins are compiled next, and they have access to everything that's in Plugins as well as outside of Plugins.
Scripts outside of Plugins are compiled next, and they have access to everything that's in Plugins as well as outside of Plugins.
Re: Reference a class from another folder
I got it right the first time and somehow managed to not fully understand it lol
Thanks
Thanks