Ejemplo n.º 1
0
    public static WGSellGroupItemView  CreateSellGroupItemView()
    {
        if (mObj == null)
        {
            mObj = Resources.Load("pbWGSellGroupItemView");
        }
        GameObject          go = Instantiate(mObj) as GameObject;
        WGSellGroupItemView sg = go.GetComponent <WGSellGroupItemView>();

        return(sg);
    }
Ejemplo n.º 2
0
    void OnBtnSell()
    {
        BCSoundPlayer.Play(MusicEnum.button);
        WGDataController _dataCtrl = WGDataController.Instance;

//		DataPlayerController dpc = DataPlayerController.getInstance();
        if (mCanSellNum > 0)
        {
            WGSellGroupItemView sgv = WGSellGroupItemView.CreateSellGroupItemView();

            SDK.AddChild(sgv.gameObject, WGRootManager.Self.goRootTopUI);

            sgv.FreshSellGroupWithID(mObjID1, mObjID2, mObjID3, mCanSellNum);

            sgv.alertViewBehavriour = (ab, view) => {
                switch (ab)
                {
                case MDAlertBehaviour.CLICK_OK:
                {
                    view.hiddenView();
                    FreshUI();
                }
                break;

                case MDAlertBehaviour.CLICK_CANCEL:
                    view.hiddenView();
                    break;

                case MDAlertBehaviour.DID_HIDDEN:

                    Destroy(view.gameObject);
                    break;
                }
            };

            return;
        }
        else
        {
            WGAlertViewController.Self.showAlertView(1011).alertViewBehavriour = (ab, view) => {
                switch (ab)
                {
                case MDAlertBehaviour.CLICK_OK:
                    view.hiddenView();
                    break;

                case MDAlertBehaviour.DID_HIDDEN:
                    WGAlertViewController.Self.hiddeAlertView(view.gameObject);
                    break;
                }
            };
        }
    }