Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. using UnityEngine;
  2. using MaterialUI;
  3. using LitJson;
  4.  
  5. public class PromoButton : MonoBehaviour
  6. {
  7. public JsonData json;
  8.  
  9. public void OnPromoButtonClicked()
  10. {
  11. this.gameObject.SetActive(false);
  12. string contenetType = json["type"].ToString();
  13.  
  14. switch (contenetType)
  15. {
  16. case "promo":
  17. PromoDialog promoDialog = DialogManager.CreateCustomDialog<PromoDialog>("Dialogs/PromoDialog");
  18. promoDialog.Initialize();
  19. promoDialog.isModal = true;
  20. promoDialog.causedButton = this.gameObject;
  21. promoDialog.Show();
  22. break;
  23.  
  24. case "intar":
  25. InfoDialog infoDialog = DialogManager.CreateCustomDialog<InfoDialog>("Dialogs/InfoDialog");
  26. infoDialog.Initialize(json["message"].ToString(), null, "OK", "My Big Info", MaterialIconHelper.GetRandomIcon(), null, null);
  27. infoDialog.isModal = true;
  28. infoDialog.causedButton = this.gameObject;
  29. infoDialog.Show();
  30. break;
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement