ball 项目提交

This commit is contained in:
2026-04-20 12:06:34 +08:00
parent 4331ebba60
commit 99145facbd
6052 changed files with 576445 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
using UnityEditor;
using UnityEditor.Callbacks;
using System.IO;
using UnityEngine;
public class GradleFixer
{
[PostProcessBuild]
public static void OnPostBuild(BuildTarget target, string path)
{
if (target != BuildTarget.Android) return;
string wrapperPath = Path.Combine(path, "gradle", "wrapper", "gradle-wrapper.properties");
string customContent = "distributionUrl=gradle-8.7-bin.zip";
if (File.Exists(wrapperPath))
{
File.WriteAllText(wrapperPath, customContent);
Debug.Log("✅ gradle-wrapper.properties 已替换为自定义版本");
}
else
{
Debug.LogWarning("⚠️ 未找到 gradle-wrapper.properties,可能 Unity 构建未生成 wrapper");
}
}
}