- Home /
How to reference a file outside a project ?
Hello, and thanks in advance for your time.
I would like to know if is was possible to reference a file which is outside the asset folder of my unity project. I mean, the file would be accessible from the editor, but would be located somewhere else.
The problem is that I have to get some data from Perforce ( = svn) repository, and that i want my files to be updated in unity as i pull them from the server.
I tried an alias but it didn't work ( i didn't really expect it to )
Would someone have a solution please?
Vincent
(PS: sorry if there are some english mistakes)
I do not think you can do it. But why do you like to access files outside your project folder? Any specific reason?
I have a big hierarchy of a project developed by another company. I need to access their resources that i update in my perforce repository. For an iteration matter, I would like that, when their push updated resources on the sever, I will not have to copy/paste them every time. So a link to the folder containing their resources would be great. I manage to do it by a symbolic link but i'm not sure at all that unity will automatically build the actual files ins$$anonymous$$d of the link
As a unity customer who has paid $25,000 in licenses for this tool, I must say that this is completely unacceptable. $$anonymous$$odularity in unity is useless, and the workflow for setting up projects and sharing code among projects and objects among scenes needs to be greatly improved.
Answer by doug__ · Dec 19, 2012 at 03:46 PM
As far as I'm aware, the answer is no.
I use rsync to copy files in, trigger by an editor command for stuff like this, but it's annoying; after executing the import, you must do a project sync to make the files available in the editor.
Perhaps you can do a similar sort of thing?
You can invoke your choice of external command (eg. xcopy, git, etc.) like this:
var p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "/bin/ls";
p.StartInfo.Arguments = "/tmp";
p.Start();
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();
UnityEngine.Debug.Log(output);