diff --git a/Assets/YooAsset/Samples~/Space Shooter/ThirdParty/StreamingAssetsHelper/Editor/StreamingAssetsHelperEditor.cs b/Assets/YooAsset/Samples~/Space Shooter/ThirdParty/StreamingAssetsHelper/Editor/StreamingAssetsHelperEditor.cs index ca39468..8688c70 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/ThirdParty/StreamingAssetsHelper/Editor/StreamingAssetsHelperEditor.cs +++ b/Assets/YooAsset/Samples~/Space Shooter/ThirdParty/StreamingAssetsHelper/Editor/StreamingAssetsHelperEditor.cs @@ -34,10 +34,22 @@ internal class AndroidPost : UnityEditor.Android.IPostGenerateGradleAndroidProje " return false; \n" + " } \n" + "}"; - if (!readContent[readContent.Length - 18].Contains("CheckAssetExist")) + + if (CheckFunctionExist(readContent) == false) readContent[readContent.Length - 1] = postContent; 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; + } } /*