| | |
| | | [SerializeField] GameObject lockMoneyGo; |
| | | [SerializeField] Button unlockMoneyBtn; //货币解锁 |
| | | [SerializeField] Image unlockMoneyIcon; |
| | | [SerializeField] Image unlockMoneyRedpoint; |
| | | [SerializeField] Text unlockMoneyText; |
| | | [SerializeField] GameObject goldRushMissionWaitGo; //未发布任务 |
| | | [SerializeField] GameObject goldRushMissionWorkingGo; //已发布任务 |
| | |
| | | GoldRushManager.Instance.OnGoldRushInfoEvent += Display; |
| | | GoldRushManager.Instance.OnRefreshItemEvent += OnRefreshItemEvent; |
| | | GlobalTimeEvent.Instance.secondEvent += OnSecondEvent; |
| | | PlayerDatas.Instance.playerDataRefreshEvent += OnPlayerDataRefreshEvent; |
| | | leaderCount = GoldRushManager.Instance.GetCampWorkerCnt(campID); |
| | | Display(); |
| | | |
| | |
| | | GoldRushManager.Instance.OnGoldRushInfoEvent -= Display; |
| | | GoldRushManager.Instance.OnRefreshItemEvent -= OnRefreshItemEvent; |
| | | GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent; |
| | | PlayerDatas.Instance.playerDataRefreshEvent -= OnPlayerDataRefreshEvent; |
| | | } |
| | | |
| | | void OnPlayerDataRefreshEvent(PlayerDataType type) |
| | | { |
| | | if (type == GoldRushManager.Instance.unLockMoneyType) |
| | | { |
| | | if (GoldRushManager.Instance.GetCampLockState(campID) == 2) |
| | | { |
| | | var campConfig = GoldRushCampConfig.Get(campID); |
| | | unlockMoneyRedpoint.SetActive(UIHelper.CheckMoneyCount(campConfig.MoneyUnlock[0], campConfig.MoneyUnlock[1], 0)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | void FixFollowWoker(int lockState) |
| | |
| | | unLockBtn.SetActive(false); |
| | | lockMoneyGo.SetActive(true); |
| | | |
| | | unlockMoneyRedpoint.SetActive(UIHelper.CheckMoneyCount(campConfig.MoneyUnlock[0], campConfig.MoneyUnlock[1], 0)); |
| | | unlockMoneyIcon.SetIconWithMoneyType(campConfig.MoneyUnlock[0]); |
| | | unlockMoneyText.text = campConfig.MoneyUnlock[1].ToString(); |
| | | goldRushMissionWaitGo.SetActive(false); |
| | |
| | | } |
| | | } |
| | | |
| | | if (followBack) |
| | | if (followBack&& GoldRushManager.Instance.GetCampWorkerCnt(campID) == 0) |
| | | { |
| | | StartMove(true); |
| | | workState = 2; |