From cdaf6f0dca7e0907b9a32dc1ae0c036ea2d76cc1 Mon Sep 17 00:00:00 2001 From: hevinci Date: Fri, 24 Feb 2023 16:52:50 +0800 Subject: [PATCH] update samples --- .../Editor/StreamingAssetsHelperEditor.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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; + } } /*