using Naninovel;
using Naninovel.Commands;
using UnityEngine;
[CommandAlias("ad")]
public class SHOWAD : Command
{
public StringParameter AdType="";
public override UniTask ExecuteAsync (AsyncToken asyncToken = default)
{
if(Assigned(AdType))
{
if(AdType == "ask" || AdType == "Ask")
AdManager.instance.ShowRewardBasedVideo();
else
AdManager.instance.ShowRewardedInterstitial();
}
if(Random.Range(0,3)==0)
{
AdManager.instance.ShowInterstitial();
}
return UniTask.CompletedTask;
}
}
There are no errors, so the only hint I may have is that using naninovel.commands is apparently not being used right now, according to vs code.
The goal is to be able to select a good time for an ad to show.
Thanks for letting me know, and its not that the process doesn't work. I haven't gotten a chance to try it. It shows up as an error in my nani scripts itself. So I assumed it didn't properly become a usable command.
Okay, an update. It DOES work, I just hadn't went ahead and tested due to the red squiggle errors that showed up in the script and made me assume the namespace did have my command in it correctly.