appodeal / appodeal-unity-plugin-upm

Appodeal Unity Plugin for UPM distribution
https://docs.appodeal.com/unity/get-started
Apache License 2.0
9 stars 6 forks source link

Wrong ad prefab search filter if there are other assets with a similar name #19

Closed EraCat2 closed 1 year ago

EraCat2 commented 1 year ago

Hi guys! I ran into an SDK initialization issue when trying to test ads in the Unity editor. I have a script named "RewardedAdManager" and DummyAppodealClient finds this script and tries to use it as an ad and I get an error.

https://github.com/appodeal/appodeal-unity-plugin-upm/blob/4c9c09738284b39a5d78bdb380e8163474f2e050/Runtime/Platforms/Monetization/Dummy/DummyAppodealClient.cs#L219

I suggest adding an explicit asset type to the filter string:

var assetGuids = AssetDatabase.FindAssets(prefabName + " t:prefab");

It helps for me.

Perhaps you should mention this behavior somewhere, because it's not obvious that you shouldn't have assets with names similar to your prefab's name) Thank you!

DmitriiFeshchenko commented 1 year ago

@EraCat2, hi. Thanks for your suggestions!

I already renamed those files to minimize the risk of having other assets with similar names. This change will be included in v3.1.x release which should hopefully be published in 1-2 weeks.

I like your idea to use a type filter when finding test ad assets. I added this task to my backlog.