| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | |
| | | isOpenCostScroll = !isOpenCostScroll; |
| | | costScroll.SetActive(isOpenCostScroll); |
| | | costArrow.transform.localRotation = Quaternion.Euler(0, 0, isOpenCostScroll ? 180 : 0); |
| | | AutoFightModel.Instance.ClickCostRed(); |
| | | }); |
| | | changeSpeedBtn.AddListener(() => |
| | | { |
| | | isOpenSpeedScroll = !isOpenSpeedScroll; |
| | | speedScroll.SetActive(isOpenSpeedScroll); |
| | | speedArrow.transform.localRotation = Quaternion.Euler(0, 0, isOpenSpeedScroll ? 180 : 0); |
| | | AutoFightModel.Instance.ClickSpeedRed(); |
| | | }); |
| | | |
| | | betterEquipToggle.AddListener((bool value) => |
| | |
| | | costScroll.AddCell(ScrollerDataType.Header, i + 1); |
| | | } |
| | | costScroll.Restart(); |
| | | if (BlessLVManager.Instance.m_TreeLV >= AutoFightModel.Instance.autoCostWithBlessLV[Math.Min(AutoFightModel.Instance.autoCostWithBlessLV.Length - 1, 2)]) |
| | | { |
| | | costScroll.JumpIndex(2); |
| | | } |
| | | } |
| | | |
| | | void CreateSpeedScroll() |
| | |
| | | { |
| | | var btn = cell.GetComponent<Button>(); |
| | | var needtaskCount = TaskManager.Instance.GetNeedFinishTaskCount(AutoFightModel.Instance.speed2UnlockMissionID); |
| | | RechargeCount _rechargeCount; |
| | | bool isbuy = false; |
| | | if (RechargeManager.Instance.TryGetRechargeCount(AutoFightModel.Instance.speed3UnlockCTGID, out _rechargeCount)) |
| | | { |
| | | isbuy = _rechargeCount.totalCount > 0; |
| | | } |
| | | |
| | | bool isbuy = InvestModel.Instance.IsActiveFightSpeed(3); |
| | | bool isActiveSpeed2 = needtaskCount <= 0 || isbuy; |
| | | |
| | | btn.AddListener(() => |
| | | { |
| | | if (cell.index == 2) |
| | | { |
| | | if (needtaskCount > 0) |
| | | if (!isActiveSpeed2) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("autofight2", needtaskCount); |
| | | return; |
| | |
| | | var cntText = cell.GetComponentInChildren<Text>(); |
| | | if (cell.index == 2) |
| | | { |
| | | cntText.text = UIHelper.AppendColor(needtaskCount > 0 ? TextColType.Gray : TextColType.LightWhite, cell.index.ToString()); |
| | | cntText.text = UIHelper.AppendColor(!isActiveSpeed2 ? TextColType.Gray : TextColType.LightWhite, cell.index.ToString()); |
| | | } |
| | | else if (cell.index == 3) |
| | | { |