update samples

pull/72/head
hevinci 2023-02-24 16:52:50 +08:00
parent e38d0bc6d0
commit cdaf6f0dca
1 changed files with 13 additions and 1 deletions

View File

@ -34,10 +34,22 @@ internal class AndroidPost : UnityEditor.Android.IPostGenerateGradleAndroidProje
" return false; \n" + " return false; \n" +
" } \n" + " } \n" +
"}"; "}";
if (!readContent[readContent.Length - 18].Contains("CheckAssetExist"))
if (CheckFunctionExist(readContent) == false)
readContent[readContent.Length - 1] = postContent; readContent[readContent.Length - 1] = postContent;
System.IO.File.WriteAllLines(untityActivityFilePath, readContent); System.IO.File.WriteAllLines(untityActivityFilePath, readContent);
} }
private bool CheckFunctionExist(string[] contents)
{
for (int i = 0; i < contents.Length; i++)
{
if (contents[i].Contains("CheckAssetExist"))
{
return true;
}
}
return false;
}
} }
/* /*