Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using MaterialUI;
- using LitJson;
- public class PromoButton : MonoBehaviour
- {
- public JsonData json;
- public void OnPromoButtonClicked()
- {
- this.gameObject.SetActive(false);
- string contenetType = json["type"].ToString();
- switch (contenetType)
- {
- case "promo":
- PromoDialog promoDialog = DialogManager.CreateCustomDialog<PromoDialog>("Dialogs/PromoDialog");
- promoDialog.Initialize();
- promoDialog.isModal = true;
- promoDialog.causedButton = this.gameObject;
- promoDialog.Show();
- break;
- case "intar":
- InfoDialog infoDialog = DialogManager.CreateCustomDialog<InfoDialog>("Dialogs/InfoDialog");
- infoDialog.Initialize(json["message"].ToString(), null, "OK", "My Big Info", MaterialIconHelper.GetRandomIcon(), null, null);
- infoDialog.isModal = true;
- infoDialog.causedButton = this.gameObject;
- infoDialog.Show();
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement