diff --git a/Assets/Public/GooglePlayGames/com.google.play.games/Editor/GPGSUtil.cs b/Assets/Public/GooglePlayGames/com.google.play.games/Editor/GPGSUtil.cs index 4eadb15a..a5016824 100644 --- a/Assets/Public/GooglePlayGames/com.google.play.games/Editor/GPGSUtil.cs +++ b/Assets/Public/GooglePlayGames/com.google.play.games/Editor/GPGSUtil.cs @@ -22,6 +22,7 @@ namespace GooglePlayGames.Editor using System.Collections.Generic; using System.IO; using System.Xml; + using System.Linq; using UnityEditor; using UnityEngine; @@ -108,7 +109,7 @@ public static class GPGSUtil /// The Games SDK requires additional metadata in the AndroidManifest.xml /// file. private const string ManifestRelativePath = - "../../Plugins/Android/GooglePlayGamesManifest.androidlib/AndroidManifest.xml"; + "Plugins/Android/GooglePlayGamesManifest.androidlib/AndroidManifest.xml"; private const string RootFolderName = "com.google.play.games"; @@ -187,7 +188,17 @@ private static string GameInfoPath /// file. private static string ManifestPath { - get { return SlashesToPlatformSeparator(Path.Combine(RootPath, ManifestRelativePath)); } + get + { + bool isInAssetsDir = RootPath.Split(Path.DirectorySeparatorChar) + .Contains("Assets"); + + string manifestPath = isInAssetsDir + ? Path.Combine(RootPath, "../../", ManifestRelativePath) + : Path.Combine(Application.dataPath, ManifestRelativePath); + + return SlashesToPlatformSeparator(manifestPath); + } } ///