Unity-将脚本文件移动到其他目录而不会丢失参考 [英] Unity - Move Script-Files to other directory without reference loss
问题描述
由于其他脚本的可访问性,我必须将我的GameManager-Script移到更高的目录.
I have to move my GameManager-Script to a higher directory, due to accessability from another script.
但是,如果我尝试将脚本从一个文件夹移动到另一目录-所有引用都将消失!我的意思是-来自所有脚本的所有引用.
But if I try to move the script from one folder to another directory - all references die! And I mean like - all references from all scripts.
真的很难从头开始重新配置所有脚本.就像从头开始.
It would be really hard to configure all scripts again from the scratch. Its like starting from the beginning.
这是游戏管理目录(资产->标准资产):
Here is the GameManagement-Directory (Assets->Standard Assets):
这里是目录,我必须将"GameManagement"移动到(资产):
Here is the the Directory, where I have to move the "GameManagement" to (Assets):
也许有人知道如何移动脚本而不会丢失参考.
Maybe someone knows how to move scripts without reference loss.
谢谢.
推荐答案
好的,我知道问题出在哪里.
Ok guys I know what the problem was.
如果要在Unity中移动文件,请确保在资源管理器中进行操作-而不是在IDE中进行操作.
If you move files in Unity, make sure that you do that in the Explorer - NOT in the IDE.
因为还必须使用脚本来移动元数据文件.
Because you have to move the metadata-file with the script as well.
对我有用.
这篇关于Unity-将脚本文件移动到其他目录而不会丢失参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!