| using UnityEngine; | 
| using UnityEngine.UI; | 
| using System.Collections.Generic; | 
|   | 
|   | 
| //主线关卡的 波次显示 | 
| public class MainLevelWaveCell : MonoBehaviour | 
| { | 
|   | 
|     [SerializeField] GameObject passLevelBG;    //已通关和正在通关的 | 
|     [SerializeField] Image passMark;    //已通关的标记 | 
|     [SerializeField] GameObject nowLevelMark;    //当前关卡 | 
|     [SerializeField] Image levelMark;   //关卡的标记 类似精英关,随机关的标识;休息时和未通关显示 | 
|   | 
|   | 
|   | 
|   | 
|     //index从0开始 | 
|     public void Display(int index) | 
|     { | 
|         var theWave = index + 1; | 
|         //ExAttr2   用于记录主线当前刷怪所在章节关卡记录,记录值 = 章节*10000+关卡编号*100+第x波  ; 0418刷新类型103 | 
|         var value = PlayerDatas.Instance.baseData.ExAttr2; | 
|         var waveID = value % 100; | 
|   | 
|         passLevelBG.SetActive(theWave <= waveID); | 
|         levelMark.SetActive(theWave >= waveID); | 
|         passMark.SetActive(theWave < waveID); | 
|   | 
|         if (theWave == waveID) | 
|         {  | 
|   | 
|             if (BattleManager.Instance.storyBattleField != null && | 
|                 BattleManager.Instance.storyBattleField.GetBattleMode() == BattleMode.Stop) | 
|             { | 
|                 levelMark.SetActive(true); | 
|                 nowLevelMark.SetActive(false); | 
|             } | 
|             else | 
|             { | 
|                 nowLevelMark.SetActive(true); | 
|                 levelMark.SetActive(false); | 
|             } | 
|         } | 
|         else | 
|         { | 
|             nowLevelMark.SetActive(false); | 
|         } | 
|   | 
|         levelMark.SetSprite("MainBossMark" + (index % 2)); | 
|         levelMark.SetNativeSize(); | 
|     } | 
|   | 
| } |