Skip to content

Commit

Permalink
Add check on upper char at suffix of cas-settings name
Browse files Browse the repository at this point in the history
  • Loading branch information
Jedures committed Sep 9, 2021
1 parent a17cc07 commit 27cb1ce
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Editor/CASEditorUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down

0 comments on commit 27cb1ce

Please sign in to comment.