Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue when the GooglePlayGames is placed out of the Assets directory. #3158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace GooglePlayGames.Editor
using System.Collections.Generic;
using System.IO;
using System.Xml;
using System.Linq;
using UnityEditor;
using UnityEngine;

Expand Down Expand Up @@ -108,7 +109,7 @@ public static class GPGSUtil
/// <remarks>The Games SDK requires additional metadata in the AndroidManifest.xml
/// file. </remarks>
private const string ManifestRelativePath =
"../../Plugins/Android/GooglePlayGamesManifest.androidlib/AndroidManifest.xml";
"Plugins/Android/GooglePlayGamesManifest.androidlib/AndroidManifest.xml";

private const string RootFolderName = "com.google.play.games";

Expand Down Expand Up @@ -187,7 +188,17 @@ private static string GameInfoPath
/// file. </remarks>
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);
}
}

/// <summary>
Expand Down