You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
679 B
C#
38 lines
679 B
C#
2 months ago
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using D2D.UI;
|
||
|
using D2D.Utilities;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public class ReviveOnClick : DButtonListener
|
||
|
{
|
||
|
|
||
|
[SerializeField] private bool _isButton;
|
||
|
|
||
|
protected bool Was { get; private set; }
|
||
|
|
||
|
private bool _isClaimClickMissed;
|
||
|
|
||
|
private void Update()
|
||
|
{
|
||
|
if (!_isButton && DInput.IsMouseReleased)
|
||
|
OnClick();
|
||
|
}
|
||
|
|
||
|
protected override void OnClick()
|
||
|
{
|
||
|
if (Was)
|
||
|
return;
|
||
|
|
||
|
Was = true;
|
||
|
|
||
|
ShowRewardedAd();
|
||
|
}
|
||
|
|
||
|
|
||
|
private void ShowRewardedAd()
|
||
|
{
|
||
|
AdsManager.Instance.ShowRewardedAd(RewardedTypes.Revive);
|
||
|
}
|
||
|
}
|