Exemplo n.º 1
0
    public void CreateYNPopup(string desc, eYNPopup type)
    {
        if (PopupPanel != null)
            DestroyImmediate(PopupPanel);

        PopupPanel = GameObject.Instantiate(Resources.Load("Prefabs/UI/YNPopupPanel") as GameObject) as GameObject;
        PopupPanel.GetComponent<YNPopupPanel>().Init(desc, type);
    }
Exemplo n.º 2
0
    // Use this for initialization
    public void Init(string desc, eYNPopup type)
    {
        PopupType = type;

        YNPopupDesc = GameObject.Find("YNPopupDesc");
        YesBtn      = GameObject.Find("YesBtn");
        NoBtn       = GameObject.Find("NoBtn");

        UIEventListener.Get(YesBtn).onClick = OnClickYes;
        UIEventListener.Get(NoBtn).onClick  = OnClickNo;

        YNPopupDesc.GetComponent <UILabel>().text = desc;
    }