Ejemplo n.º 1
0
    private void OnRespondActive(EventBase evt)
    {
        WingUIEvent wevt = evt as WingUIEvent;

        if (wevt.result == (int)ERROR_CODE.ERR_WING_ACTIVE_OK)
        {
            jihuoAni.gameObject.SetActive(false);
            GameDebug.Log("激活" + mWingMoudle.GetWingPageCount());
            CreateWingItem(mWingMoudle.GetWingPageCount());
            winggrid.GetComponent <UIGrid>().repositionNow = true;
            upDownAniHandler();
        }
    }
Ejemplo n.º 2
0
    protected override void OnRespond(respond_equip_wing respond, object userdata)
    {
        WingEquipActionParam param = userdata as WingEquipActionParam;

        if (param.action == 0)
        {
            if (respond.result == (int)ERROR_CODE.ERR_WING_EQUIP_OK)
            {
                Player ply = PlayerController.Instance.GetControlObj() as Player;
                if (ply != null)
                {
                    ply.WingEquip(param.wingid, param.action);
                }

                GameDebug.Log("装备成功" + param.wingid);
                WingUIEvent evt = new WingUIEvent(WingUIEvent.WING_UI_EQUIP);
                evt.wingid = param.wingid;
                evt.result = respond.result;
                evt.action = param.action;
                EventSystem.Instance.PushEvent(evt);
            }
            else
            {
                GameDebug.Log("装备失败" + param.wingid);
            }
        }
        else
        {
            if (respond.result == (int)ERROR_CODE.ERR_WING_TAKEOFF_OK)
            {
                GameDebug.Log("卸载成功" + param.wingid);
                Player ply = PlayerController.Instance.GetControlObj() as Player;
                if (ply != null)
                {
                    ply.WingEquip(param.wingid, param.action);
                }

                WingUIEvent evt = new WingUIEvent(WingUIEvent.WING_UI_EQUIP);
                evt.wingid = param.wingid;
                evt.result = respond.result;
                evt.action = param.action;
                EventSystem.Instance.PushEvent(evt);
            }
            else
            {
                GameDebug.Log("卸载失败" + param.wingid);
            }
        }
    }
Ejemplo n.º 3
0
    private void OnRespondEquip(EventBase evt)
    {
        WingUIEvent wevt = evt as WingUIEvent;

        if (wevt.action == 0)
        {
            equipWord.text = StringHelper.GetString("wing_takeoff");
            UIAtlasHelper.SetButtonImage(equipBtn, "common:btn_blue_4word");
        }
        else if (wevt.action == 1)
        {
            equipWord.text = StringHelper.GetString("wing_equip");
            UIAtlasHelper.SetButtonImage(equipBtn, "common:btn_yellow_4word");
        }
    }
Ejemplo n.º 4
0
    protected override void OnRespond(respond_active_wing respond, object userdata)
    {
        if (respond.result == (int)ERROR_CODE.ERR_WING_ACTIVE_OK)
        {
            GameDebug.Log("激活成功" + Convert.ToInt32(userdata));
        }
        else
        {
            GameDebug.Log("激活失败" + Convert.ToInt32(userdata));
        }

        WingUIEvent evt = new WingUIEvent(WingUIEvent.WING_UI_ACTIVE);

        evt.wingid = Convert.ToInt32(userdata);
        evt.result = respond.result;
        EventSystem.Instance.PushEvent(evt);
    }
Ejemplo n.º 5
0
 protected override void OnRespond(respond_forge_wing respond, object userdata)
 {
     if (respond.result == (int)ERROR_CODE.ERR_WING_FORGE_OK)
     {
         GameDebug.Log("精炼成功" + Convert.ToInt32(userdata));
         WingUIEvent evt = new WingUIEvent(WingUIEvent.WING_UI_FORGE);
         evt.wingid = Convert.ToInt32(userdata);
         evt.result = respond.result;
         EventSystem.Instance.PushEvent(evt);
     }
     else if (respond.result == (int)ERROR_CODE.ERR_WING_FORGE_ITEM_NO_ENOUGH)
     {
         GameDebug.Log("道具不足");
     }
     else
     {
         GameDebug.Log("精炼失败" + Convert.ToInt32(userdata));
     }
 }