public override bool OnDragging(Ray cameraRay) { PEStationCtrl mousePickedStation = GetStation(); if (null != mousePickedStation && !mousePickedStation.isJoint && PERailwayCtrl.CheckRoute(mousePickedStation.point)) { rootGameObject.transform.position = mousePickedStation.station.mJointPoint.position; rootGameObject.transform.rotation = mousePickedStation.station.mJointPoint.rotation; return(true); } base.OnDragging(cameraRay); return(false); }
public bool RemoveOriginItem() { bool result = false; switch (mItemPlace) { case ItemPlaceType.IPT_Bag: GameUI.Instance.mItemPackageCtrl.SetItemWithIndex(null, mItemIndex); result = true; break; case ItemPlaceType.IPT_Equipment: //lz-2016.11.09 里面需要处理多人 result = GameUI.Instance.mUIPlayerInfoCtrl.RemoveEquipmentByIndex(mItemIndex); break; case ItemPlaceType.IPT_Warehouse: result = GameUI.Instance.mWarehouse.SetItemWithIndex(null, mItemIndex); break; case ItemPlaceType.IPT_ServantInteraction: result = GameUI.Instance.mServantWndCtrl.SetItemWithIndex(null, mItemIndex); break; case ItemPlaceType.IPT_ServantInteraction2: result = GameUI.Instance.mServantWndCtrl.SetItemWithIndexWithPackage2(null, mItemIndex); break; case ItemPlaceType.IPT_ServantEqu: //lz-2016.11.09 里面需要处理多人 result = GameUI.Instance.mServantWndCtrl.RemoveEqByIndex(mItemIndex); break; case ItemPlaceType.IPT_ConolyServantInteractionTrain: result = GameUI.Instance.mCSUI_MainWndCtrl.TrainUI.SetItemWithIndex(null, mItemIndex); break; case ItemPlaceType.IPT_ConolyServantEquTrain: result = GameUI.Instance.mCSUI_MainWndCtrl.TrainUI.SetItemWithIndex(null, mItemIndex); break; case ItemPlaceType.IPT_ColonyServantInteractionPersonel: result = GameUI.Instance.mCSUI_MainWndCtrl.PersonnelUI.m_NPCInfoUI.SetInteractionItemWithIndex(null, mItemIndex); break; case ItemPlaceType.IPT_ColonyServantInteraction2Personel: result = GameUI.Instance.mCSUI_MainWndCtrl.PersonnelUI.m_NPCInfoUI.SetInteraction2ItemWithIndex(null, mItemIndex); break; case ItemPlaceType.IPT_ConolyServantEquPersonel: //lz-2016.11.09 里面需要处理多人 result = GameUI.Instance.mCSUI_MainWndCtrl.PersonnelUI.m_NPCEquipUI.EquipRemoveOriginItem(mItemIndex); break; case ItemPlaceType.IPT_Repair: GameUI.Instance.mRepair.RemoveItem(); result = true; break; case ItemPlaceType.IPT_Rail: PERailwayCtrl.RemoveTrain(ItemObj); result = true; break; } // - [CSUI] RemoveOriginItem if (mGrid != null && mGrid.onRemoveOriginItem != null) { mGrid.onRemoveOriginItem(mGrid); result = true; } return(result); }
void OnSeletedLine(bool isConnect, int routeID, int stationID) { isConnectLine = isConnect; ChangeUILineInfo(isConnect); if (mSelectedLineId != -1) { UIRailLine lineOld = mRailLineList.Find( delegate(UIRailLine li) { return(li.mRoute.id == mSelectedLineId); }); if (lineOld != null) { lineOld.SetSelected(false); } UIDisconnectionLine disLineOld = mDisRailLineList.Find( delegate(UIDisconnectionLine li) { return(li.mIndex == mSelectedLineId); }); if (disLineOld != null) { disLineOld.SetSelected(false); } } if (isConnect) { UIRailLine line = mRailLineList.Find( delegate(UIRailLine li) { return(li.mRoute.id == routeID); }); if (line == null) { ClearLineInfo(); return; } mSelectedLineIndex = mRailLineList.FindIndex( delegate(UIRailLine li) { return(li == line); }); line.SetSelected(true); mSelectedLineId = routeID; SetLineInfo(line.mRoute); if (mSelectedStation != null) { mSelectedStation.SetSelected(false); } UIRailStation station = line.FindStation(stationID); if (station != null) { station.SetSelected(true); mSelectedStation = station; } SetSatationInfo(station.mRailPointData); EnableBtn(mBtnStop, true); } else { int index = routeID; UIDisconnectionLine disLine = mDisRailLineList.Find( delegate(UIDisconnectionLine li) { return(li.mIndex == index); }); if (disLine == null) { ClearLineInfo(); return; } disLine.SetSelected(true); mSelectedLineId = index; if (mSelectedStation != null) { mSelectedStation.SetSelected(false); } UIRailStation station = disLine.FindStation(stationID); if (station != null) { station.SetSelected(true); mSelectedStation = station; } SetSatationInfo(station.mRailPointData); bool ok = PERailwayCtrl.CheckRoute(station.mRailPointData); EnableBtn(mBtnStop, ok); } }
void Awake() { mInstance = this; }