示例#1
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));
                }
            }
        }
    }
示例#2
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;
    }