Пример #1
0
 private void GiveUpOnClick()
 {
     ConfirmUI.Open("確定要放棄嗎?\n放棄後會直接回到村莊。", "確定", "取消", () =>
     {
         BattleController.Instance.GiveUp();
     }, null);
 }
Пример #2
0
 private void CloseOnClick()
 {
     if (ItemManager.Instance.CurrentBagVolume > ItemManager.Instance.MaxBagVolume)
     {
         ConfirmUI.Open("背包已滿!請選擇要丟棄的道具。", "確定", null);
     }
     else
     {
         Close();
     }
 }
Пример #3
0
    public void Interactive(Vector2Int position)
    {
        if (_mapInfo.TreasureDic.ContainsKey(position))
        {
            ItemManager.Instance.AddItem(_mapInfo.TreasureDic[position].ItemList, ItemManager.Type.Bag);
            TilePainter.Instance.Clear(1, position);
            ItemConfirmUI.Open(_mapInfo.TreasureDic[position].ItemList);
            _mapInfo.TreasureDic.Remove(position);
            _pathFindList.Add(position);

            if (ItemManager.Instance.BagIsFull())
            {
                ConfirmUI.Open("背包已滿!請選擇要丟棄的道具。", "確定", () =>
                {
                    BagUI.Open(ItemManager.Type.Bag);
                });
            }
            SetInteractive(Vector2Int.RoundToInt(_player.transform.position));
        }
        else if (_mapInfo.DoorList.Contains(position))
        {
            if (ItemManager.Instance.UseKey())
            {
                TilePainter.Instance.Clear(1, position);
                _mapInfo.DoorList.Remove(position);
                _pathFindList.Add(position);
                SetVisibleRange(false);
                ExploreUI.Instance.RefreshLittleMap(Vector2Int.RoundToInt(_player.transform.position), _mapInfo.ExploredList, _mapInfo.ExploredWallList);
            }
            else
            {
                ConfirmUI.Open("需要一把鑰匙將鎖打開。", "確定", null);
            }
            SetInteractive(Vector2Int.RoundToInt(_player.transform.position));
        }
        else if (_mapInfo.ExploreEventDic.ContainsKey(position))
        {
            _player.Stop();
            EventUI.Open(_mapInfo.ExploreEventDic[position], (isDonothing) =>
            {
                _player.UnlockStop();
                ContinueEnemy();
                if (!isDonothing)
                {
                    TilePainter.Instance.Clear(1, position);
                    _mapInfo.ExploreEventDic.Remove(position);
                    _pathFindList.Add(position);
                }
                SetInteractive(Vector2Int.RoundToInt(_player.transform.position));
            });
        }
    }
Пример #4
0
    private void BagIconOnClick(object obj)
    {
        Item item = (Item)obj;

        if (item.ID == 0) //如果道具為緊急逃脫裝置,則不得移除,因為它是必備的道具
        {
            ConfirmUI.Open("必需攜帶緊急逃脫裝置。", "確定", null);
        }
        else
        {
            ItemManager.Instance.AddItem(item, 1, ItemManager.Type.Warehouse);
            ItemManager.Instance.MinusItem(item, 1, ItemManager.Type.Bag);
            Refresh();
        }
    }
Пример #5
0
 private void MapOnClick(object obj)
 {
     if (obj != null)
     {
         DungeonGroupData.RootObject   group     = (DungeonGroupData.RootObject)obj;
         List <DungeonData.RootObject> floorList = DungeonData.GetFloorList(group.ID, ExploreController.Instance.ArriveFloor);
         FloorScrollView.SetData(new ArrayList(floorList));
         FloorScrollView.gameObject.SetActive(true);
         //GroupScrollView.gameObject.SetActive(false);
         MapGroup.SetActive(false);
         GroupLabel.text = group.Name;
     }
     else
     {
         ConfirmUI.Open("敬請期待!", "確定", null);
     }
 }
Пример #6
0
 private void ConfirmOnClick()
 {
     if (ItemManager.Instance.BagIsFull())
     {
         ConfirmUI.Open("背包已滿!請選擇要丟棄的道具。", "確定", () =>
         {
             BagUI.Open(ItemManager.Type.Bag);
         });
     }
     else
     {
         if (_callback != null)
         {
             _callback();
         }
     }
 }
Пример #7
0
 private void NewOnClick()
 {
     if (ProgressManager.Instance.Memo.FirstFlag) //已完成新手教學
     {
         ConfirmUI.Open("請問你確定要重新開始遊戲嗎?", "確定", "取消", () =>
         {
             GameSystem.Instance.ClearMemo();
             GameSystem.Instance.InitManager();
             gameObject.SetActive(false);
             Plot_1 plot_1 = new Plot_1();
             plot_1.Start();
         }, null);
     }
     else
     {
         gameObject.SetActive(false);
         Plot_1 plot_1 = new Plot_1();
         plot_1.Start();
     }
 }