| | |
| | | |
| | | //底部功能 |
| | | [SerializeField] Button autoBtn; |
| | | [SerializeField] Image autoCloseImg; |
| | | [SerializeField] UIEffectPlayer autoOpenEffect; |
| | | [SerializeField] Button blessLVBtn; |
| | | [SerializeField] Text blessLVText; |
| | | |
| | |
| | | |
| | | autoBtn.AddListener(() => |
| | | { |
| | | //测试拾取所有物品 |
| | | var items = PackManager.Instance.GetItems(PackType.DropItem); |
| | | List<int> dropindexs = new List<int>(); |
| | | for (int i = 0; i < items.Count; i++) |
| | | { |
| | | var item = items[i]; |
| | | if (dropindexs.Count > 5) |
| | | { |
| | | EquipModel.Instance.NotifyItemDrop(dropindexs, BattleManager.Instance.storyBattleField.battleRootNode.blueTeamNodeList[Random.Range(0, 5)].GetComponent<RectTransform>()); |
| | | dropindexs.Clear(); |
| | | } |
| | | // //测试拾取所有物品 |
| | | // var items = PackManager.Instance.GetItems(PackType.DropItem); |
| | | // List<int> dropindexs = new List<int>(); |
| | | // for (int i = 0; i < items.Count; i++) |
| | | // { |
| | | // var item = items[i]; |
| | | // if (dropindexs.Count > 5) |
| | | // { |
| | | // EquipModel.Instance.NotifyItemDrop(dropindexs, BattleManager.Instance.storyBattleField.battleRootNode.blueTeamNodeList[Random.Range(0, 5)].GetComponent<RectTransform>()); |
| | | // dropindexs.Clear(); |
| | | // } |
| | | |
| | | dropindexs.Add(item.gridIndex); |
| | | } |
| | | if (dropindexs.Count > 0) |
| | | // dropindexs.Add(item.gridIndex); |
| | | // } |
| | | // if (dropindexs.Count > 0) |
| | | // { |
| | | // EquipModel.Instance.NotifyItemDrop(dropindexs, BattleManager.Instance.storyBattleField.battleRootNode.blueTeamNodeList[Random.Range(0, 5)].GetComponent<RectTransform>()); |
| | | // dropindexs.Clear(); |
| | | // } |
| | | if (!FuncOpen.Instance.IsFuncOpen(108, true)) |
| | | { |
| | | EquipModel.Instance.NotifyItemDrop(dropindexs, BattleManager.Instance.storyBattleField.battleRootNode.blueTeamNodeList[Random.Range(0, 5)].GetComponent<RectTransform>()); |
| | | dropindexs.Clear(); |
| | | return; |
| | | } |
| | | UIManager.Instance.OpenWindow<AutoFightWin>(); |
| | | }); |
| | | |
| | | |
| | |
| | | UpdateTask(); |
| | | RefreshRecharge(); |
| | | ShowBlessLV(); |
| | | DisplayAutoFight(); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | |
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh; |
| | | TaskManager.Instance.OnTaskUpdate += UpdateTask; |
| | | BlessLVManager.Instance.OnBlessLVUpdateEvent += ShowBlessLV; |
| | | AutoFightModel.Instance.ChangeAutoEvent += DisplayAutoFight; |
| | | Display(); |
| | | // var battleWin = UIManager.Instance.OpenWindow<BattleWin>(); |
| | | // battleWin.SetBattleField(BattleManager.Instance.storyBattleField); |
| | |
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh; |
| | | TaskManager.Instance.OnTaskUpdate -= UpdateTask; |
| | | BlessLVManager.Instance.OnBlessLVUpdateEvent -= ShowBlessLV; |
| | | AutoFightModel.Instance.ChangeAutoEvent -= DisplayAutoFight; |
| | | |
| | | // 关闭的时候把战斗界面也给关了 虽然是在外面开的 |
| | | UIManager.Instance.CloseWindow<BattleWin>(); |
| | |
| | | { |
| | | blessLVText.text = BlessLVManager.Instance.m_TreeLV.ToString(); |
| | | } |
| | | |
| | | void DisplayAutoFight() |
| | | { |
| | | if (AutoFightModel.Instance.isAutoAttackSet) |
| | | { |
| | | autoCloseImg.SetActive(false); |
| | | autoOpenEffect.Play(); |
| | | } |
| | | else |
| | | { |
| | | autoCloseImg.SetActive(true); |
| | | autoOpenEffect.Stop(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新玩家信息 |