| | |
| | | [SerializeField] FillTween cdTween; |
| | | |
| | | [SerializeField] Button clickEmptyBtn; |
| | | |
| | | [SerializeField] Image emptyLockImg; |
| | | [SerializeField] Image redPointImg; |
| | | [SerializeField] UIEffectPlayer unlockEffect; |
| | | |
| | | void OnEnable() |
| | | { |
| | |
| | | } |
| | | |
| | | string guid; |
| | | public void Display(int index) |
| | | int lockIndex; |
| | | public void Display(int index, List<TeamHero> heros) |
| | | { |
| | | var team = TeamManager.Instance.GetTeam(TeamType.Story); |
| | | var teamHero = team.GetServerHeroByIndex(index); |
| | | TeamHero teamHero = null; |
| | | if (index < heros.Count) |
| | | { |
| | | teamHero = heros[index]; |
| | | } |
| | | guid = teamHero != null ? teamHero.guid : ""; |
| | | if (guid == "") |
| | | { |
| | | clickHeroBtn.SetActive(false); |
| | | clickEmptyBtn.SetActive(true); |
| | | clickEmptyBtn.AddListener(ClickEmpty); |
| | | emptyLockImg.SetActive(false); |
| | | redPointImg.SetActive(false); |
| | | |
| | | int lockCnt = HeroUIManager.Instance.lockIndexList.Count; |
| | | //根据锁数量 倒序判断锁住 |
| | | if (lockCnt > 0) |
| | | { |
| | | lockIndex = lockCnt - (TeamConst.MaxTeamHeroCount - 1 - index) - 1; |
| | | if (lockIndex >= 0 && lockIndex < lockCnt) |
| | | { |
| | | emptyLockImg.SetActive(true); |
| | | redPointImg.SetActive(HeroUIManager.Instance.CanUnLock(HeroUIManager.Instance.lockIndexList[lockIndex])); |
| | | } |
| | | } |
| | | |
| | | return; |
| | | } |
| | | else |
| | |
| | | |
| | | void ClickEmpty() |
| | | { |
| | | if (emptyLockImg.isActiveAndEnabled) |
| | | { |
| | | if (HeroUIManager.Instance.UnLockHeroCnt(lockIndex)) |
| | | { |
| | | unlockEffect.onComplete = () => |
| | | { |
| | | HeroUIManager.Instance.OnUnLockHeroCountEvent?.Invoke(); |
| | | SysNotifyMgr.Instance.ShowTip("HeroCountUnLock5", TeamConst.MaxTeamHeroCount - HeroUIManager.Instance.lockIndexList.Count); |
| | | }; |
| | | unlockEffect.Play(); |
| | | } |
| | | return; |
| | | } |
| | | UIManager.Instance.OpenWindow<HeroCallWin>(); |
| | | } |
| | | void OnSkillCast(bool isfighting) |