Won't accept custom c9mmand
I Can't figure out what I'm doing wrong:
(disclaimer, I'm not a pro at all)
Here's the code, but @showAd does nothing still..
Code: Select all
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.