Jump to content

How to stop Unity from unnecessarily overwriting files randomly?


HebaruSan

Recommended Posts

I'm experimenting with Kopernicus's ring shader, which means I am finally forced to use the Unity Editor.

The shader source file itself is in the Kopernicus repository, but the project used to compile the shader is in a separate shader-export repository. To work properly, the compilation project needs to access the source, but I don't want to have to worry about manually copying files back and forth as I make changes. The natural solution is a symbolic link from the compilation project to the real file in Kopernicus.

At first this worked fine, but at some point something unknown to me changed, and now when I compile the shader, Unity also replaces my symbolic link with a regular file copy of the shader source. As far as I can tell, nothing I've done has requested this behavior. Since I'm editing the real one in the Kopernicus repository, the next time I trigger a compile, my latest changes aren't reflected, which is inhibiting my efforts to "learn by doing."

Is there a way to tell Unity not to mess with files I haven't requested it to touch? Alternately, can I compile shaders for Unity without using the Unity Editor (a very attractive option since it also seems to consume 100% CPU when idle)? A command-line solution would be ideal.

Link to comment
Share on other sites

Of course the simple solution becomes apparent only after I've posted the question:

sudo chown -h wifes_username shader-export/Assets/Shaders shader-export/Assets/Shaders/ringsShader.shader

If my user can't delete or edit the symbolic link (because another user owns it and the directory containing it), then neither can Unity when it runs as me, whether it likes it or not.

For the 100% CPU bug (reposted from the Unity forums):

cpulimit -l 10 -e Unity &

Methods for compiling a shader into an asset bundle on the command line are still welcome, but this will work for the time being.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...