private void Update() { m_Timer += Time.deltaTime; if (m_OpenDoor == true) { OpenDoor(); } else { CloseDoor(); } if (m_EnterTriggerRange == true) { if (m_Locked == true) { //显示按F互动的提示 TipFollowDoor(); //如果按了F键 if (Input.GetKeyDown(KeyCode.F)) { //判断是否有资格进入 //如果玩家还没有获取资格 if (PlayerInfo.DoorA == false) { UITool.CreateGossipUICustom("I Need the AchievesRoomCard!"); } else { UITool.CreateGossipUICustom("Woooo!At last the door opened!"); if (m_Tip != null) { Destroy(m_Tip); } m_OpenDoor = true; m_Locked = false; } } } } }
private void JudgeInStay() { Debug.Log(111); switch (m_Speaker) { case ENUM_Speaker.Scientist_A: if (Input.GetKeyDown(KeyCode.F)) { if (PlayerInfo.TalkToNpcA == false) { DialogFormat dialog = DialogData.GetNextDialogData(ENUM_DialogType.PlayerTrigger_A); if (dialog != null) { //显示对话内容 UITool.ShowDialogText(dialog); //更改游戏状态为Talking GlobalValue.ChangeGamePhare(ENUM_GamePhase.Talking); } else { UITool.HideDialogText(); //添加任务 TaskFormat task = new TaskFormat(); task.TaskName = "Find Food"; task.TaskDescription = "Map Right UP And Right Middle"; PlayerInfo.AddTaskList(task); //更新玩家数据 PlayerInfo.TalkToNpcA = true; //更改游戏状态为Play GlobalValue.ChangeGamePhare(ENUM_GamePhase.Play); //告诉你食物的位置 UITool.ShowFoodInMap(); } } else if (PlayerInfo.MissionDoneA == false) { if (PlayerInfo.Food > 0) { --PlayerInfo.Food; //任务奖励,告诉你注射剂的位置 UITool.ShowIntectionInMap(); PlayerInfo.MissionDoneA = true; //取消任务 PlayerInfo.RemoveTaskList("Find Food"); } else { UITool.CreateGossipUICustom("I need find food!"); } } else { UITool.CreateGossipUICustom("There is no task here!"); } } break; case ENUM_Speaker.Scientist_B: if (Input.GetKeyDown(KeyCode.F)) { if (PlayerInfo.TalkToNpcB == false) { DialogFormat dialog = DialogData.GetNextDialogData(ENUM_DialogType.PlayerTrigger_B); if (dialog != null) { //显示对话内容 UITool.ShowDialogText(dialog); GlobalValue.ChangeGamePhare(ENUM_GamePhase.Talking); } else { UITool.HideDialogText(); //添加任务 TaskFormat task = new TaskFormat(); task.TaskName = "Find Food2"; task.TaskDescription = "Map Right"; PlayerInfo.AddTaskList(task); //更新玩家数据 PlayerInfo.TalkToNpcB = true; GlobalValue.ChangeGamePhare(ENUM_GamePhase.Play); } } else if (PlayerInfo.MissionDoneB == false) { if (PlayerInfo.Food > 0) { --PlayerInfo.Food; //任务奖励,拥有上锁的门的钥匙 PlayerInfo.DoorA = true; PlayerInfo.MissionDoneB = true; //取消任务 PlayerInfo.RemoveTaskList("Find Food2"); } else { UITool.CreateGossipUICustom("I need find food!"); } } else { UITool.CreateGossipUICustom("There is no task here!"); } } break; default: break; } }