Files
tysdk-intergration/sdk-intergration/Packages/tysdk/Editor/AndroidBuildProcessor.cs
2024-12-10 12:15:59 +08:00

21 lines
729 B
C#

using System.IO;
using UnityEditor.Android;
namespace tysdk.editor
{
public class AndroidPostBuildProcessor : IPostGenerateGradleAndroidProject
{
public int callbackOrder => 1;
public void OnPostGenerateGradleAndroidProject(string path)
{
UnityEngine.Debug.Log($"OnPostGenerateGradleAndroidProject {path}");
var projectPath = Directory.GetParent(path).ToString();
var googleServicesJsonPath = "Packages/tysdk/Files/google-services.json";
var googleServicesTargetPath = Path.Combine(projectPath, "launcher/google-services.json");
File.Copy(googleServicesJsonPath, googleServicesTargetPath, true);
}
}
}