In this script when player and capsule or cubes touches they gotta be destroyed. code destroys cubes but it doesn't work for capsules, any idea?
public void HandleAdResult(ShowResult result)
{
switch (result)
{
case ShowResult.Finished:
Time.timeScale = 1f;
GameObject.Destroy(gameObject);
break;
I have this method for advertisement
public void Watchit() {
UnityEngine.Advertisements.Advertisement.Show("rewardedVideo", new ShowOptions() { resultCallback = HandleAdResult });
}
and i call it from another script attached to a button like this (Carpisma is the script for codes above)
public GameObject ui;
public void watchit() {
Carpisma usit = FindObjectOfType();
usit.Watchit();
ui.SetActive(!ui.activeSelf);
}
↧