void ClickFunc(GameObject go) { if (CurNpcInfo != null) { NewFunctionRef funcRef = ConfigMng.Instance.GetNewFunctionRef(CurNpcInfo.Function); if (funcRef != null) { switch (funcRef.id) //这里处理按钮功能 { case 7: //结义 GameCenter.swornMng.C2S_ReqAddBrother(ConfigMng.Instance.GetUItext(337)); break; case 8://仙侣 GameCenter.uIMng.GenGUI(GUIType.MARRIAGE, true); break; case 10: //充值返利 GameCenter.rechargeMng.C2S_ReqTestChargeReward(); break; default: if (funcRef.UI_type == 1) { GameCenter.uIMng.SwitchToUI((GUIType)Enum.Parse(typeof(GUIType), funcRef.UI_name)); } else if (funcRef.UI_type == 2) { GameCenter.uIMng.SwitchToSubUI((SubGUIType)Enum.Parse(typeof(SubGUIType), funcRef.UI_name)); } break; } } } if (CurModelInfo != null) { GameCenter.activityMng.C2S_Morship(); GameCenter.uIMng.SwitchToUI(GUIType.NONE); } }
void CloseWnd(GameObject go) { if (CurNpcInfo != null) { NewFunctionRef funcRef = ConfigMng.Instance.GetNewFunctionRef(CurNpcInfo.Function); if (funcRef != null) { switch (funcRef.id) { case 9: if (GameCenter.activityMng.rewardId != 0) { //GameCenter.activityMng.rewardId = 0; GameCenter.activityMng.C2S_ReqGetReward(); //Debug.Log("领取夺宝奇兵奖励!!!"); } break; } } } GameCenter.uIMng.SwitchToUI(GUIType.NONE); }
void ShowNpcInfo() { if (CurNpcInfo == null) { return; } if (npcName != null) { npcName.text = CurNpcInfo.Name; } if (npcTexture != null) { GameCenter.previewManager.TryPreviewSingelNPC(CurNpcInfo, npcTexture, PreviewConfigType.Dialog); } NewFunctionRef funcRef = ConfigMng.Instance.GetNewFunctionRef(CurNpcInfo.Function); if (content != null) { content.gameObject.SetActive(true); } if (unContent != null) { unContent.gameObject.SetActive(false); } if (funcRef != null) { switch (funcRef.id) //这里处理特殊显示 { case 7: //结义 if (npcTalk != null) { int count = GameCenter.swornMng.HisName().Count; if (count == 1) //两人结义 { npcTalk.text = ConfigMng.Instance.GetUItext(30, new string[1] { GameCenter.swornMng.HisName()[0] }); } else if (count == 2) //三人结义 { npcTalk.text = ConfigMng.Instance.GetUItext(31, new string[2] { GameCenter.swornMng.HisName()[0], GameCenter.swornMng.HisName()[1] }); } else { if (content != null) { content.gameObject.SetActive(false); } if (unContent != null) { unContent.gameObject.SetActive(true); } } } break; case 8: //仙侣 if (npcTalk != null && GameCenter.coupleMng.HerName() != string.Empty) { npcTalk.text = ConfigMng.Instance.GetUItext(29, new string[1] { GameCenter.coupleMng.HerName() }); } else { if (content != null) { content.gameObject.SetActive(false); } if (unContent != null) { unContent.gameObject.SetActive(true); } } break; case 10: //充值返利 if (npcTalk != null) { npcTalk.text = ConfigMng.Instance.GetUItext(130, new string[2] { GameCenter.rechargeMng.TestRechargeRewardDiamo.ToString(), GameCenter.rechargeMng.TestRechargeRewardVipExp.ToString() }); } break; case 9: //夺宝奇兵 if (npcTalk != null) { npcTalk.enabled = (GameCenter.activityMng.rewardId == 0); } if (content != null) { content.gameObject.SetActive(GameCenter.activityMng.rewardId != 0); } if (GameCenter.activityMng.rewardId != 0 && content != null) { ItemUI itemUI = content.GetComponentInChildren <ItemUI>(); if (itemUI != null) { itemUI.FillInfo(new EquipmentInfo(GameCenter.activityMng.rewardId, EquipmentBelongTo.PREVIEW)); } } else if (npcTalk != null) { npcTalk.text = ConfigMng.Instance.GetUItext(334); } break; } } }
public override bool Exec(Actor _actor) { if (target == null) { return(true); } if (target.isDummy) { return(false); } if (GameCenter.curGameStage == null || !GameCenter.sceneMng.EnterSucceed) { return(false); } Vector3 targetPos = target.transform.position; Vector3 diff = _actor.transform.position - targetPos; if (diff.sqrMagnitude <= minDistance * minDistance) { GameCenter.curMainPlayer.CurTarget = target; target.InteractionSound(); switch (target.typeID) { case ObjectType.Unknown: break; case ObjectType.Player: break; case ObjectType.PreviewPlayer: break; case ObjectType.Mount: break; case ObjectType.MOB: break; case ObjectType.NPC: if (GameCenter.uIMng.HaveBigWnd()) { return(true); } List <NPC> npcs = GameCenter.curGameStage.GetNPCs(); for (int i = 0; i < npcs.Count; i++) { npcs[i].CancelBubble(); } NPC npc = target as NPC; if (npc != null) { npc.BeClick(); } NPCTypeRef npcType = ConfigMng.Instance.GetNPCTypeRef(npc.id); if (npcType.function1 != 0) { NewFunctionRef newFunction = ConfigMng.Instance.GetNewFunctionRef(npcType.function1); if (GameCenter.mainPlayerMng.FunctionIsOpen((FunctionType)newFunction.Function_type)) { if (newFunction.NPC_UI_type == 1) { GameCenter.uIMng.SwitchToUI((GUIType)Enum.Parse(typeof(GUIType), newFunction.NPC_UI_name)); } else if (newFunction.NPC_UI_type == 2) { GameCenter.uIMng.SwitchToSubUI((SubGUIType)Enum.Parse(typeof(SubGUIType), newFunction.NPC_UI_name)); } } else { GameCenter.uIMng.SwitchToUI(GUIType.NPCDIALOGUE); } } else if (npcType.function2 != 0) { NewFunctionRef newFunction = ConfigMng.Instance.GetNewFunctionRef(npcType.function2); if (GameCenter.mainPlayerMng.FunctionIsOpen((FunctionType)newFunction.Function_type)) { if (newFunction.NPC_UI_type == 1) { GameCenter.uIMng.SwitchToUI((GUIType)Enum.Parse(typeof(GUIType), newFunction.NPC_UI_name)); } else if (newFunction.NPC_UI_type == 2) { GameCenter.uIMng.SwitchToSubUI((SubGUIType)Enum.Parse(typeof(SubGUIType), newFunction.NPC_UI_name)); } } else { GameCenter.uIMng.SwitchToUI(GUIType.NPCDIALOGUE); } } else { GameCenter.uIMng.SwitchToUI(GUIType.NPCDIALOGUE); //走到NPC身边,打开NPC对话UI } break; case ObjectType.SceneItem: SceneItem sceneitem = target as SceneItem; if (sceneitem != null && sceneitem.IsTouchType == TouchType.TOUCH) { if (GameCenter.mainPlayerMng.MainPlayerInfo.CurMountInfo != null && GameCenter.mainPlayerMng.MainPlayerInfo.CurMountInfo.IsRiding) //下坐骑 { GameCenter.newMountMng.C2S_ReqRideMount(ChangeMount.DOWNRIDE, GameCenter.mainPlayerMng.MainPlayerInfo.CurMountInfo.ConfigID, MountReqRideType.AUTO); } } if (GameCenter.mainPlayerMng.MainPlayerInfo.CurSceneUiType == SceneUiType.RAIDERARK) { if (GameCenter.activityMng.rewardId != 0) //已携带宝珠错误提示 { GameCenter.messageMng.AddClientMsg(456); return(true); } if (Time.time > 15 && Time.time - GameCenter.activityMng.coldGetTime < 15) { MessageST msg = new MessageST(); msg.messID = 459; msg.words = new string[1] { (15 - (int)(Time.time - GameCenter.activityMng.coldGetTime)).ToString() }; GameCenter.messageMng.AddClientMsg(msg); return(true); } } if (sceneitem != null) { sceneitem.BeClicked(); } GameCenter.mainPlayerMng.C2S_TouchSceneItem(target.id); break; case ObjectType.Entourage: break; case ObjectType.DropItem: break; case ObjectType.FlyPoint: break; case ObjectType.CGObject: break; case ObjectType.Trap: break; case ObjectType.Model: //Model model = target as Model; // if (model.Camp == GameCenter.mainPlayerMng.MainPlayerInfo.Camp)//走到雕像 如果阵营相同 请求能否膜拜并开窗 // GameCenter.campMng.C2S_CanWorship(); GameCenter.uIMng.SwitchToUI(GUIType.NPCMORSHIP); break; default: break; } return(true); } return(false); }
public override bool Exec(Actor _actor) { if (firstTime) { if (targetScene == 0) { GameCenter.mainPlayerMng.C2S_Fly_Pint(GameCenter.mainPlayerMng.MainPlayerInfo.SceneID, (int)targetPos.x, (int)targetPos.z); } else { GameCenter.mainPlayerMng.C2S_Fly_Pint(targetScene, (int)targetPos.x, (int)targetPos.z); } firstTime = false; } if (targetScene != 0 && targetScene != GameCenter.mainPlayerMng.MainPlayerInfo.SceneID) { return(false); } if ((targetScene != 0 && targetScene == GameCenter.mainPlayerMng.MainPlayerInfo.SceneID && GameCenter.sceneMng.EnterSucceed) || targetScene == 0) { Vector3 delta = targetPos - _actor.transform.position; delta.y = 0f; if (targetID == 0) { if (delta.sqrMagnitude < minDistance * minDistance) { GameCenter.curMainPlayer.PlayFlyOverEffect(); return(true); } } else { if (delta.sqrMagnitude < minDistance * minDistance) { InteractiveObject obj = GameCenter.curGameStage.GetInterActiveObj(targetID); if (obj != null && !obj.isDummy) { switch (obj.typeID) { case ObjectType.NPC: NPC npc = obj as NPC; GameCenter.curMainPlayer.CurTarget = npc; if (npc != null) { npc.BeClick(); } NPCTypeRef npcType = ConfigMng.Instance.GetNPCTypeRef(npc.id); if (npcType.function1 != 0) { NewFunctionRef newFunction = ConfigMng.Instance.GetNewFunctionRef(npcType.function1); if (GameCenter.mainPlayerMng.FunctionIsOpen((FunctionType)newFunction.Function_type)) { if (newFunction.NPC_UI_type == 1) { GameCenter.uIMng.SwitchToUI((GUIType)Enum.Parse(typeof(GUIType), newFunction.NPC_UI_name)); } else if (newFunction.NPC_UI_type == 2) { GameCenter.uIMng.SwitchToSubUI((SubGUIType)Enum.Parse(typeof(SubGUIType), newFunction.NPC_UI_name)); } } else { GameCenter.uIMng.SwitchToUI(GUIType.NPCDIALOGUE); } } else if (npcType.function2 != 0) { NewFunctionRef newFunction = ConfigMng.Instance.GetNewFunctionRef(npcType.function2); if (GameCenter.mainPlayerMng.FunctionIsOpen((FunctionType)newFunction.Function_type)) { if (newFunction.NPC_UI_type == 1) { GameCenter.uIMng.SwitchToUI((GUIType)Enum.Parse(typeof(GUIType), newFunction.NPC_UI_name)); } else if (newFunction.NPC_UI_type == 2) { GameCenter.uIMng.SwitchToSubUI((SubGUIType)Enum.Parse(typeof(SubGUIType), newFunction.NPC_UI_name)); } } else { GameCenter.uIMng.SwitchToUI(GUIType.NPCDIALOGUE); } } else { GameCenter.uIMng.SwitchToUI(GUIType.NPCDIALOGUE); //走到NPC身边,打开NPC对话UI } break; } GameCenter.curMainPlayer.PlayFlyOverEffect(); return(true); } } } } return(false); }