AdManager.cs 870 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using UnityEngine;
  3. using System.Collections;
  4. public class AdManager : MonoBehaviour
  5. {
  6. public static AdManager Instance;
  7. private TimerAd BunnerAd;
  8. public int count;
  9. public Camera SmokeCam;
  10. public bool Active;
  11. void Start()
  12. {
  13. //PlayerPrefs.SetInt("Level",2);
  14. Instance = this;
  15. Adware.OnClose += () =>
  16. {
  17. //Show panels Back
  18. OnDone();
  19. };
  20. }
  21. public void PlayVideoAd()
  22. {
  23. AdManager.Instance.Active = true;
  24. //count++;
  25. if (SmokeCam != null)
  26. {
  27. SmokeCam.enabled = false;
  28. }
  29. if (/*count%2 ==0 && */Adware.Instance.Available)
  30. {
  31. Adware.Instance.Show(() => { });
  32. }
  33. else
  34. {
  35. }
  36. }
  37. public void OnDone()
  38. {
  39. }
  40. }