Project merge with name conflict

As the title, let’s name my two project A and B, both of them are independent project but very similar, for example, they each have a scene menu with the script Menu.cs.
However, now I wanna merge A and B into a big project, then make a main scene to jump into A or B’s menu, but I find that even if I export A and B, and then import them as custom package, there is always a name conflict that I cannot import two Menu.cs at the same time.
Any Answer is appreciated.

You’ll have to rename one of them. I don’t think there’s any shortcut.

For scripts you can throw them in their own namespace. Put everything in one project inside a single namespace. This should avoid name collisions.

1 Like

But how about other asset like MyAtlas in both project with the same name

Wha? The same script can be in multiple projects… You just can’t have duplicates of the same script/class in one project/namespace.

He’s trying to merge two projects that both have a MyAtlas (which is not a script, it’s some other kind of asset).

And yeah, you just have to fix those one by one — either rename one of them, or conclude that they are actually the same thing and copy just one of them into your merged project.

1 Like

Is it the same thing?

If it is the same thing, just write over one version.

If its not the same thing, put it in a different folder.

If its the same thing, but has been modified in one or both projects, fire up version control and do a diff on it and see if you can’t merge it that way.