void TaskItemCollect(Client.stTaskNpcItem stData) { if (DataManager.Manager <UIPanelManager>().IsShowPanel(PanelID.MainUsePanel)) { return; } MainUsePanelData mainUsePanelData = new MainUsePanelData(); mainUsePanelData.type = stData.type; mainUsePanelData.Id = stData.Id; mainUsePanelData.onClick = MainUsePanelItemOnClick; this.tempNpcId = stData.Id; bool enterCityWar = DataManager.Manager <CityWarManager>().EnterCityWar; bool enterCamp = DataManager.Manager <CampCombatManager>().isEnterScene; //城战,阵营战不出采集,这两个副本是占领塔 if (enterCityWar || enterCamp) { return; } DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.MainUsePanel, data: mainUsePanelData); }
void OnPlayerStopMove(ref Client.stEntityStopMove stopEntity, int nEventId) { if (curTreasureMap == null) { return; } Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.ROBOTCOMBAT_SEARCHPATH, false); Vector3 mainPos = Client.ClientGlobal.Instance().MainPlayer.GetPos(); if (mainPos.x == curTreasureMap.TargetPosition.x && mainPos.z == -curTreasureMap.TargetPosition.y) { if (DataManager.Manager <UIPanelManager>().IsShowPanel(PanelID.MainUsePanel)) { return; } if (arriveTargetStopMove) { return; } MainUsePanelData mainUsePanelData = new MainUsePanelData(); mainUsePanelData.type = 2; mainUsePanelData.Id = curTreasureMap.BaseId; mainUsePanelData.onClick = MainUsePanelItemOnClick; DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.MainUsePanel, data: mainUsePanelData); arriveTargetStopMove = true; } }
protected override void OnShow(object data) { base.OnShow(data); Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.TASK_MAIN_ARROWHIDE, null); //if (DataManager.Manager<TaskDataManager>().IsShowSlider) if (DataManager.Manager <SliderDataManager>().IsReadingSlider) { this.HideSelf(); return; } startPos = Client.ClientGlobal.Instance().MainPlayer.GetPos(); m_nRang = GameTableManager.Instance.GetGlobalConfig <int>("Task_UseItem_Rang"); m_nRang *= m_nRang; /* if (data is uint) * { * ShowItemInfo((uint)data); * } */ //新的 this.m_mainUsePanelData = data as MainUsePanelData; if (this.m_mainUsePanelData != null) { ShowItemInfo(this.m_mainUsePanelData); } }
void ShowItemInfo(MainUsePanelData data) { /* * List<BaseItem> lstItems = DataManager.Manager<ItemManager>().GetItemByBaseId(itemBaseid); * if (lstItems.Count <= 0) * { * m_nitemThisId = 0; * m_nitemBaseId = 0; * return; * } * m_nitemThisId = lstItems[0].QWThisID; * m_nitemBaseId = itemBaseid; */ //npc if (data.type == 1) { m__icon.gameObject.SetActive(false); m_sprite_iconCollect.gameObject.SetActive(true); Client.IEntitySystem es = Client.ClientGlobal.Instance().GetEntitySystem(); if (es == null) { return; } INPC npc = es.FindNPC(data.Id); if (npc == null) { return; } //this.name = npc.GetName(); this.name = "采集"; m_label_item_name.text = string.Format("{0}[ffd966]({1})[-]", this.name, CLOSE_TIME); } //item else if (data.type == 2) { m__icon.gameObject.SetActive(true); m_sprite_iconCollect.gameObject.SetActive(false); table.ItemDataBase itemdata = GameTableManager.Instance.GetTableItem <table.ItemDataBase>(data.Id); if (itemdata != null) { UIManager.GetTextureAsyn(itemdata.itemIcon, ref m_iconCASD, () => { if (null != m__icon) { m__icon.mainTexture = null; } }, m__icon); //this.name = itemdata.itemName; this.name = "使用"; m_label_item_name.text = string.Format("{0}[ffd966]({1})[-]", this.name, CLOSE_TIME); } } //特效 UIParticleWidget wight = m_sprite_iconBg.GetComponent <UIParticleWidget>(); if (null == wight) { wight = m_sprite_iconBg.gameObject.AddComponent <UIParticleWidget>(); wight.depth = 100; } if (wight != null) { UIParticleWidget p = wight.GetComponent <UIParticleWidget>(); if (p == null) { p = wight.gameObject.AddComponent <UIParticleWidget>(); p.depth = 20; } if (p != null) { p.SetDimensions(1, 1); p.ReleaseParticle(); p.AddParticle(50019); } } StartCoroutine(WaitToClose()); }
private void OnPlayerStopMove(ref Client.stEntityStopMove stopEntity, int nEventId) { if (!Client.ClientGlobal.Instance().IsMainPlayer(stopEntity.uid)) { return; } if (m_nDoingTaskID == 0) { Engine.Utility.EventEngine.Instance().RemoveEventListener(nEventId, OnEvent); m_bAddStopMoveListener = false; return; } QuestTraceInfo questInfo = QuestTranceManager.Instance.GetQuestTraceInfo(m_nDoingTaskID); if (questInfo == null) { Engine.Utility.EventEngine.Instance().RemoveEventListener(nEventId, OnEvent); m_bAddStopMoveListener = false; return; } if (EqualsMapID(questInfo.QuestTable.destMapID)) { Engine.Utility.EventEngine.Instance().RemoveEventListener(nEventId, OnEvent); m_bAddStopMoveListener = false; uint npcid; Vector2 pos; if (questInfo.IsKillMonster(out npcid)) { Client.IMapSystem ms = Client.ClientGlobal.Instance().GetMapSystem(); if (ms.GetClienNpcPos((int)npcid, out pos)) { UnityEngine.Vector3 mainPos = Client.ClientGlobal.Instance().MainPlayer.GetPos(); if (mainPos.x == pos.x && mainPos.z == -pos.y) { Client.IControllerSystem cs = Client.ClientGlobal.Instance().GetControllerSystem(); if (cs != null) { cs.GetCombatRobot().StartWithTarget((int)npcid); Engine.Utility.Log.LogGroup("ZCX", "挂机杀怪物{0}", npcid); } } } } else if (questInfo.IsMoveToTargetPos(out pos)) { Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.ROBOTCOMBAT_SEARCHPATH, false); UnityEngine.Vector3 mainPos = Client.ClientGlobal.Instance().MainPlayer.GetPos(); if (mainPos.x == pos.x && mainPos.z == -pos.y) { if (DataManager.Manager <UIPanelManager>().IsShowPanel(PanelID.MainUsePanel)) { return; } MainUsePanelData mainUsePanelData = new MainUsePanelData(); mainUsePanelData.type = 2; // type = 2为item mainUsePanelData.Id = questInfo.QuestTable.usecommitItemID; mainUsePanelData.onClick = MainUsePanelItemOnClick; this.usecommitItemID = questInfo.QuestTable.usecommitItemID; DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.MainUsePanel, data: mainUsePanelData); // DataManager.Manager<UIPanelManager>().ShowPanel(PanelID.MainUsePanel, data: questInfo.QuestTable.usecommitItemID); } } } }