Exemplo n.º 1
0
 private void InitTrapRoomUI()
 {
     GoClickBuildBtns = NDLoad.LoadWndItem("ClickBuildBtns", WndManager.GetWndRoot().transform);
     if (GoClickBuildBtns)
     {
         m_v3GoClickBuildBtns = GoClickBuildBtns.transform.position;
         ClickBuildBtns btns = GoClickBuildBtns.GetComponent <ClickBuildBtns>();
         if (btns)
         {
             //btns.BtnInfo.OnClickEventHandler += BtnInfo_OnClickEventHandler;
             btns.BtnReturnBag.OnClickEventHandler += BtnReutrnBag_OnClickEventHandler;
             //btns.BtnUpgrade.OnClickEventHandler += BtnUpgrade_OnClickEventHandler;
             //btns.BtnDeleteSoldier.OnClickEventHandler += BtnDeleteSoldier_OnClickEventHandler;
             btns.BtnSetTransGate.OnClickEventHandler += BtnSetTransGate_OnClickEventHandler;
         }
         GoClickBuildBtns.SetActive(false);
     }
     SetClickBuildBtns(false, false);
     if (m_Core.m_type == ShipBuildType.BuildRoom)
     {
         BuildProperty lifeobj = GetComponent <BuildProperty>();
         if (lifeobj != null && lifeobj.GetModeType() == 1605)
         {
             SetClickBuildBtns(false, true);
         }
     }
 }
Exemplo n.º 2
0
    void BtnSetTransGate_OnClickEventHandler(UIButton sender)
    {
        SetBuildParaStart();
        List <CanvasCore> childrenCore = PutCanvasM.GetChildByCore(m_Core);

        if (childrenCore.Count == 0)
        {
#if UNITY_EDITOR_LOG
            NGUIUtil.DebugLog("房间内未检测到传送门,请调查!!!");
#endif
            return;
        }
        ShipPlan P = ShipPlanDC.GetCurShipPlan();
        if (P == null)
        {
            return;
        }
        foreach (var childCore in childrenCore)
        {
            TouchMove     tm      = PutCanvasM.GetTouchMoveByCore(childCore);
            BuildProperty lifeobj = tm.GetComponent <BuildProperty>();
            if (lifeobj != null && lifeobj.GetModeType() == 1605)
            {
                Building1605 b = lifeobj.GetLife() as Building1605;
                if (b != null)
                {
                    ShipPutInfo Info = P.GetShipBuildInfo(m_Core);
                    b.ShowTranGate(new Int2(Info.shipput_data0, Info.shipput_data1));
                }
            }
        }
    }
Exemplo n.º 3
0
    /// <summary>
    /// 设置参数(如传送门的传送点)
    /// </summary>
    void SetPara()
    {
        if (RoomMap.CheckRoomGridInBoat(m_roomGridTouchDown))
        {
            TouchMove tm = TouchMoveManager.GetCurTouchMove();
            if (tm)
            {
                Int2       paramPos = m_roomGridTouchDown.SoldierPos;
                CanvasCore buildRoomCoreTouchDown = m_roomGridTouchDown.GetBuildRoom();
                tm.SetBuildParam(buildRoomCoreTouchDown, paramPos.Unit, paramPos.Layer);
                tm.SetBuildParaOver();
                //传送门 这里没获取到

                BuildProperty lifeobj = tm.GetComponent <BuildProperty>();
                if (lifeobj != null && lifeobj.GetModeType() == 1605)
                {
                    Building1605 b1605 = lifeobj.GetLife() as Building1605;
                    if (b1605 != null)
                    {
                        b1605.SetTransGate(paramPos);
                    }
                }
            }
        }
        else
        {
            NGUIUtil.ShowTipWndByKey("88800013");
        }
        m_roomGridTouchDown = null;
    }