public void TalkWithNPC(NPC npc) { InputManager.Instance.TalkingNPC_ID = npc.NPC_ID; TalkDialog dialog = Instantiate(talkDialogPrefab); dialog.transform.SetParent(canvas.transform); dialog.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, 0); dialog.Initial(npc); SentenceManager.Instance.ToNext(); }
private void SearchMonster() { Scene scene = World.Instance.FindScene(PlayerManager.Instance.Player.LocatedSceneID); var monsterTeam = scene.MonsterZone.GetMonsterTeam(); if (scene.MonsterZone == null || monsterTeam == null) { TalkDialog dialog = Instantiate(talkDialogPrefab); dialog.transform.SetParent(canvas.transform); dialog.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, 0); dialog.Initial(new NPC(0, "系統", "什麼都沒找到")); } else { List <Monster> monsters = new List <Monster>(); monsterTeam.ForEach(x => monsters.Add(MonsterFactory.Instance.FindMonster(x))); battlePanel.gameObject.SetActive(true); battlePanel.Initial(new BattleSystem(PlayerManager.Instance.Player, monsters)); TalkDialog dialog = Instantiate(talkDialogPrefab); dialog.transform.SetParent(canvas.transform); dialog.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, 0); dialog.Initial(new NPC(0, "系統", "戰鬥")); } }