Added Revive state and rewarded ad
parent
0f798993bc
commit
5a31274499
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class GameManager : MonoBehaviour
|
||||||
|
{
|
||||||
|
public static GameManager Instance = null;
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
if (Instance is null)
|
||||||
|
Instance = this;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DestroyImmediate(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public GameObject ReviveCanvas;
|
||||||
|
|
||||||
|
public void OnRevival()
|
||||||
|
{
|
||||||
|
ReviveCanvas.gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 15aa547f90790934786675afd937e396
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,37 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b96eae8828f21dd4aaadd5c22d8bf37d
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class ReviveScreenUI : MonoBehaviour
|
||||||
|
{
|
||||||
|
public GameObject ReviveButton;
|
||||||
|
private void OnEnable()
|
||||||
|
{
|
||||||
|
ReviveButton.SetActive(AdsManager.Instance.isRewardedAdAvailable);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4a6125f6ff849814c8d7e8cdb145134a
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Loading…
Reference in New Issue