From 27cb1ceecf6eee63f38ee3252939e42c676b9a1b Mon Sep 17 00:00:00 2001 From: Vladyslav Date: Thu, 9 Sep 2021 15:10:32 +0300 Subject: [PATCH] Add check on upper char at suffix of cas-settings name --- Editor/CASEditorUtils.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Editor/CASEditorUtils.cs b/Editor/CASEditorUtils.cs index cfe6e4b..9219af8 100644 --- a/Editor/CASEditorUtils.cs +++ b/Editor/CASEditorUtils.cs @@ -111,11 +111,21 @@ public static string GetName( this AdNetwork network ) public static string GetNativeSettingsPath( BuildTarget platform, string managerId ) { - if (string.IsNullOrEmpty( managerId )) + if ( string.IsNullOrEmpty( managerId ) ) return ""; - string root = platform == BuildTarget.Android ? androidResSettingsPath : iosResSettingsPath; - return root + managerId.Length.ToString() + managerId[managerId.Length - 1] + ".json"; + char suffixLetter = managerId[managerId.Length - 1]; + if ( platform == BuildTarget.Android ) + { + if ( char.IsUpper( suffixLetter ) ) + return androidResSettingsPath + ".json"; + else + return androidResSettingsPath + managerId.Length.ToString() + suffixLetter + ".json"; + } + else + { + return iosResSettingsPath + managerId.Length.ToString() + suffixLetter + ".json"; + } } public static CASInitSettings GetSettingsAsset( BuildTarget platform, bool create = true )