private void RefreshArea(GuaJiQuYuPeiZhi data) { if (data != null) { ResourceManager.SetSprite(this.mBackground, ResourceManager.GetIconSprite(this.BG_IMG[data.areaType])); this.mTxTitle.set_text(string.Format(GameDataUtils.GetChineseContent(511636, false), AttrUtility.GetExpValueStr(data.exp))); if (data.areaType == 3) { this.mTxTips.set_text(string.Format(GameDataUtils.GetChineseContent(HuntManager.Instance.GetIntOtherData("areaInfoTip" + data.areaType), false), data.condition)); } else { this.mTxTips.set_text(GameDataUtils.GetChineseContent(HuntManager.Instance.GetIntOtherData("areaInfoTip" + data.areaType), false)); } } }
public string GetRoomName(int map, int area) { string text = string.Empty; GuaJiDiTuPeiZhi guaJiDiTuPeiZhi = DataReader <GuaJiDiTuPeiZhi> .Get(map); if (guaJiDiTuPeiZhi != null) { text = text + GameDataUtils.GetChineseContent(guaJiDiTuPeiZhi.name, false) + " "; } GuaJiQuYuPeiZhi guaJiQuYuPeiZhi = DataReader <GuaJiQuYuPeiZhi> .Get(area); if (guaJiQuYuPeiZhi != null) { text = text + GameDataUtils.GetChineseContent(511603 + guaJiQuYuPeiZhi.areaType, false) + " "; } return(text); }
public void OpenHuntAreaById(int areaId) { int cityId = areaId / 10; Debug.LogFormat("进入地图[{0}]区域[{1}]", new object[] { cityId, areaId }); HuntMapItem huntMapItem = this.mMapList.Find((HuntMapItem e) => e.Id == cityId); if (huntMapItem != null && this.OnClickCity(huntMapItem)) { GuaJiQuYuPeiZhi guaJiQuYuPeiZhi = DataReader <GuaJiQuYuPeiZhi> .Get(areaId); if (guaJiQuYuPeiZhi != null) { this.OnClickArea(guaJiQuYuPeiZhi); } } }
private void CreateArea(int areaId) { GuaJiQuYuPeiZhi guaJiQuYuPeiZhi = DataReader <GuaJiQuYuPeiZhi> .Get(areaId); if (guaJiQuYuPeiZhi != null) { HuntAreaItem huntAreaItem = this.mAreaList.Find((HuntAreaItem e) => e.get_gameObject().get_name() == "Unused"); if (huntAreaItem == null) { GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("HuntAreaItem"); UGUITools.SetParent(this.mAreaPanel, instantiate2Prefab, false); huntAreaItem = instantiate2Prefab.GetComponent <HuntAreaItem>(); huntAreaItem.EventHandler = new Action <GuaJiQuYuPeiZhi>(this.OnClickArea); this.mAreaList.Add(huntAreaItem); } huntAreaItem.SetData(guaJiQuYuPeiZhi); huntAreaItem.get_transform().set_localPosition(new Vector3((float)guaJiQuYuPeiZhi.coordinates.get_Item(0), (float)guaJiQuYuPeiZhi.coordinates.get_Item(1))); huntAreaItem.get_gameObject().set_name("Area_" + areaId); huntAreaItem.get_gameObject().SetActive(true); } }
private void OnClickArea(GuaJiQuYuPeiZhi data) { if (HuntManager.Instance.RemainTime <= 0) { if (HuntManager.Instance.CanBuyTimes - HuntManager.Instance.DayBuyTimes > 0) { UIManagerControl.Instance.OpenUI("HuntBuyTimeUI", null, false, UIType.NonPush); } else { UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(511626, false)); } } else if (HuntManager.Instance.RemainTime > 0 && data != null) { if (data.areaType == 1) { if (HuntManager.Instance.NormalRoomInfos == null || HuntManager.Instance.NormalRoomCD <= 0) { WaitUI.OpenUI((uint)(HuntManager.Instance.RefreshTime * 1000)); HuntManager.Instance.SendEnterMapUiReq(data.setMap, data.id, data.areaType); } else if (HuntManager.Instance.NormalRoomInfos != null && HuntManager.Instance.NormalRoomCD > 0) { HuntManager.Instance.SetAreaData(data); UIManagerControl.Instance.OpenUI("HuntRoomUI", null, false, UIType.NonPush); } } else if (data.areaType == 2) { if (HuntManager.Instance.ChaosRoomInfos == null || HuntManager.Instance.ChaosRoomCD <= 0) { WaitUI.OpenUI((uint)(HuntManager.Instance.RefreshTime * 1000)); HuntManager.Instance.SendEnterMapUiReq(data.setMap, data.id, data.areaType); } else if (HuntManager.Instance.ChaosRoomInfos != null && HuntManager.Instance.ChaosRoomCD > 0) { HuntManager.Instance.SetAreaData(data); UIManagerControl.Instance.OpenUI("HuntRoomUI", null, false, UIType.NonPush); } } else if (data.areaType == 3) { int vipLv = EntityWorld.Instance.EntSelf.VipLv; if (!VIPManager.Instance.IsVIPPrivilegeOn()) { DialogBoxUIViewModel.Instance.ShowAsOKCancel(GameDataUtils.GetChineseContent(621264, false), GameDataUtils.GetChineseContent(511620, false), null, delegate { LinkNavigationManager.OpenVIPUI2Privilege(); }, "取 消", "确 定", "button_orange_1", "button_yellow_1", null, true, true); return; } if (vipLv < data.condition) { DialogBoxUIViewModel.Instance.ShowAsOKCancel(GameDataUtils.GetChineseContent(621264, false), GameDataUtils.GetChineseContent(511621, false), null, delegate { LinkNavigationManager.OpenVIPUI2Recharge(); }, "取 消", "确 定", "button_orange_1", "button_yellow_1", null, true, true); return; } if (HuntManager.Instance.VipRoomInfos == null || HuntManager.Instance.VipRoomCD <= 0) { WaitUI.OpenUI((uint)(HuntManager.Instance.RefreshTime * 1000)); HuntManager.Instance.SendEnterMapUiReq(data.setMap, data.id, data.areaType); } else if (HuntManager.Instance.VipRoomInfos != null && HuntManager.Instance.VipRoomCD > 0) { HuntManager.Instance.SetAreaData(data); UIManagerControl.Instance.OpenUI("HuntRoomUI", null, false, UIType.NonPush); } } } }
public void SetData(GuaJiQuYuPeiZhi data) { this.mData = data; this.RefreshArea(data); }
public void SetAreaData(GuaJiQuYuPeiZhi areaData) { this.MapId = areaData.setMap; this.AreaId = areaData.id; this.AreaType = areaData.areaType; }