| | |
| | | |
| | | autoChallengeBossToggle.AddListener((bool value) => |
| | | { |
| | | if (!IsOpenTryChallenge(out int needtaskCount)) |
| | | if (!IsOpenTryChallenge()) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("autofight2", needtaskCount); |
| | | SysNotifyMgr.Instance.ShowTip("autofight5", AutoFightModel.Instance.openAutoChallengeBossCond / 100, AutoFightModel.Instance.openAutoChallengeBossCond % 100); |
| | | autoChallengeBossToggle.SetIsOnWithoutNotify(false); |
| | | return; |
| | | } |
| | |
| | | |
| | | autoFinishTaskToggle.AddListener((bool value) => |
| | | { |
| | | if (!IsOpenAutoFinishTask(out int needtaskCount)) |
| | | if (!IsOpenAutoFinishTask()) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("autofight2", needtaskCount); |
| | | SysNotifyMgr.Instance.ShowTip("autofight4", AutoFightModel.Instance.openAutoFinishCond); |
| | | autoFinishTaskToggle.SetIsOnWithoutNotify(false); |
| | | return; |
| | | } |
| | |
| | | speedScroll.OnRefreshCell -= OnRefreshSpeedCell; |
| | | tryChallengeScroll.OnRefreshCell -= OnRefreshTryChallengeCell; |
| | | } |
| | | bool IsOpenTryChallenge(out int needtaskCount) |
| | | bool IsOpenTryChallenge() |
| | | { |
| | | needtaskCount = TaskManager.Instance.GetNeedFinishTaskCount(AutoFightModel.Instance.openAutoChallengeBossMissionID); |
| | | return needtaskCount <= 0; |
| | | return PlayerDatas.Instance.baseData.ExAttr1 / 100 > AutoFightModel.Instance.openAutoChallengeBossCond; |
| | | } |
| | | |
| | | bool IsOpenAutoFinishTask(out int needtaskCount) |
| | | bool IsOpenAutoFinishTask() |
| | | { |
| | | needtaskCount = TaskManager.Instance.GetNeedFinishTaskCount(AutoFightModel.Instance.openAutoChallengeBossMissionID); |
| | | return needtaskCount <= 0; |
| | | return BlessLVManager.Instance.m_TreeLV >= AutoFightModel.Instance.openAutoFinishCond; |
| | | } |
| | | |
| | | void DislayTip(string key, Vector3 worldPos) |
| | |
| | | |
| | | void OnRefreshTryChallengeCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | bool isOpen = IsOpenTryChallenge(out int needtaskCount); |
| | | bool isOpen = IsOpenTryChallenge(); |
| | | bool isbuy = InvestModel.Instance.IsInvested(InvestModel.monthCardType); |
| | | var btn = cell.GetComponent<Button>(); |
| | | btn.AddListener(() => |
| | | { |
| | | if (cell.index != 1) |
| | | { |
| | | if (!isOpen) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("autofight2", needtaskCount); |
| | | return; |
| | | } |
| | | if (!isbuy) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("autofight3"); |