unity3d - How to move a MonoBehaviour to an external assembly and don't get stuck in the "Missing (mono script)"? -


i have many scripts (monobehaviour) inside game project in unity3d, many of them referenced gameobjects in scenes.

now want move of these scripts separated assembly (class library), because need use them in other projects , wish improve our code organization.

so, when move scripts external class library project , put .dll inside de unity3d assets folder, gameobjects reference moved scripts warning "missing (mono script)".

i imagine unity3d keeps track script references looking script name , assembly name.

does knows way solve problem?

unfortunately there no automated way of doing in unity. correct in unity maintains reference monobehaviour. have few options, none of them ideal:

option 1: rename monobehaviours in project "mb_xxx" xxx name of script. through unity editor , unity maintain reference. import compiled dll monobehaviours in names want use. go through each object adding in appropriate monobehaviour dll , removing mb_xxx behaviour. use 1 of unity assets asset store copy data 1 monobehaviour don't have re-enter settings.

option 2: create shell script change reference id in assets (save assets in text format) monobehaviour use 1 in dll. fortunately unity permits have monobehaviours of same name, @ least until try run game. need obtain reference ids each of monobehaviours in dll - can achieve adding of monobehaviours in dll empty gameobject , looking in generated asset file see reference ids are.

these not ideal solutions unfortunately , have wing it.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -