Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

Copy raw assets from a shared project

$
0
0

@Noxalus wrote:

Hello everyone :slight_smile:

I'm working on a multiplatforms game for Windows and Android so I created a shared project to use the same source code for both tagerts.

The problem is that in my project, I need to load raw assets and these assets are the same on Android and Windows. So I put them into my shared project but in this kind of project, we can't add copy rules like AndroidAsset.

I tried to manually update the Android project file to manually specify that I wanted to copy an external folder as raw assets like that:

<ItemGroup>
    <AndroidAsset Include="..\Core\Assets\**\*.*">
      <Link>Assets\%(RecursiveDir)%(FileName)%(Extension)</Link>
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </AndroidAsset>
  </ItemGroup>

And it kind of works, but when I add new files in the ..\Core\Assets\ folder, they are not copied. I need to relaunch the solution to take into account new files.

I also tried to use prebuild commands to do what I wanted:

xcopy "$(SolutionDir)Core\Assets" "Assets\" /Y /I /S /R

But it doesn't work as expected neither because the rule to embed the raw files into the produced APK is missing, and copy files to the Assets folder is not enough.

Do you know another solution to do what I want?

Thanks in advance :slight_smile:

Posts: 6

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles