Ejemplo n.º 1
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;
    }
Ejemplo 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));
                }
            }
        }
    }
Ejemplo n.º 3
0
    private static Building GetBuildingLife(BuildInfo Info, LifeProperty SkinProperty, LifeEnvironment Environment)
    {
        if (Info == null || SkinProperty == null)
        {
            return(null);
        }
        Building life = null;

        switch (Info.BuildType)
        {
        case 1201:
            life = new Building1201();
            break;

        case 1300:
            life = new Building1300();
            break;

        case 1601:
            life = new Building1601();
            break;

        case 1602:
            life = new Building1602();
            break;

        case 1603:
            life = new Building1603();
            break;

        case 1604:
            life = new Building1604();
            break;

        case 1605:
            life = new Building1605();
            break;

        case 1606:
            life = new Building1606();
            break;

        case 1607:
            life = new Building1607();
            break;

        case 1608:
            life = new Building1608();
            break;

        case 1609:
            life = new Building1609();
            break;

        case 1610:
            life = new Building1610();
            break;

        case 1611:
            life = new Building1611();
            break;

        case 1612:
            life = new Building1612();
            break;

        case 1613:
            life = new Building1613();
            break;

        case 1619:
            life = new Building1619();
            break;

        case 9999:
            life = new Building9999();
            break;

        case 9998:
            life = new Building9998();
            break;

        case 9997:
            life = new Building9997();
            break;

        default:
            break;
        }
        if (life != null)
        {
            life.SetBuildLife(Info, SkinProperty, Environment);
            life.InitBuildModel();
        }
        else
        {
            Debug.Log("create building fail:" + Info.BuildType);
        }
        return(life);
    }