# How can I copy an asset folder programatically depending upon a constant?

I have a Unity project in which I have 200 games and some 350 scenes. Now I want to make separate builds for each game. All my assets are present in Assets/IgnoredAssets/ABC folder. To include these assets in my current build the assets of the current game (say ABC) needs to be in Assets/Resources/ABC.

I want Unity to take these Assets/IgnoredAssets/ABC files and copy them to Assets/Resources before making build depending upon a constant defined in some file.

I want a kind of automation so that when I mention in my constant file string gameName="ABC"; it automatically picks its assets, paste them in Resources and builds for me.

How can I do this?

• Go through AssetDatabase and BuildPipeline documentation. They have all the functions that you require to achieve the same. Sep 18 '14 at 18:16

AssetDatabase.MoveAsset("Assets/Resources/<filenanme>", "Assets/Resources/<currentgame>/<filename>");

AssetDatabase.MoveAsset("Assets/IgnoredAssest/<newgame>/<filenanme>", "Assets/Resources/<filename>");