Search Unity

Any way to move Resources folder out by Editor script?

Discussion in 'Editor & General Support' started by NoobCoderFake, Dec 29, 2018.

  1. NoobCoderFake

    NoobCoderFake

    Joined:
    Nov 24, 2015
    Posts:
    42
    We want to use Resources folder during development, but build all files into assetbundles in StreamingAssets folder and then move Resources folder out of project as all resources are in streamingAssets already, or there will be two copy of each resource.
    We want to do this work automatically,
    1.Build AssetBundle into StreamingAssets;
    2.Move Resources folder out;
    3.Build project;
    4.Move Resources back.
    But when we move Resources folder out use System.IO.Directory.Move(source, dest) , an exception was throwed out, "UnauthorizedAccessException: Access to the path is denied.", so is that because of some protection by UnityEditor? Is there any way to move Resources folder out by editor script?