| | |
| | | { |
| | | |
| | | [SerializeField] CyclicScroll m_Bosses; |
| | | [SerializeField] Transform m_ContainerMonster; |
| | | [SerializeField] Text m_MonsterLevel; |
| | | [SerializeField] RawImage m_MonsterPortrait; |
| | | |
| | | [SerializeField] DogzBoxBehaviour m_BoxBehaviour; |
| | | [SerializeField] DogzEliteMonsterBehaviour m_EliteMonsterBehaviour; |
| | | [SerializeField] BossIntroduceBehaviour m_BossIntroduce; |
| | | |
| | | [SerializeField] Button m_Goto; |
| | | [SerializeField] Button m_KillRecord; |
| | | [SerializeField] Transform m_SurpassLevel; |
| | | [SerializeField] ToggleButton m_Subscribe; |
| | | [SerializeField] TextEx m_WearyValue; |
| | | |
| | | [SerializeField] RectTransform m_ContainerBoxCollectWeary; |
| | | [SerializeField] TextEx m_BoxCollectWearyValue; |
| | | [SerializeField] RectTransform m_ContainerBossKillWeary; |
| | | [SerializeField] TextEx m_BossKillWearyValue; |
| | | |
| | | DogzDungeonModel model { get { return ModelCenter.Instance.GetModel<DogzDungeonModel>(); } } |
| | | FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } } |
| | |
| | | private void ShowBosses() |
| | | { |
| | | var bosses = model.GetBosses(); |
| | | model.selectedBoss = model.GetLatestUnLockBoss(); |
| | | model.selectedBoss = model.GetRecommendBoss(); |
| | | m_Bosses.Init(bosses); |
| | | m_Bosses.MoveToCenter(bosses.IndexOf(model.selectedBoss)); |
| | | |
| | | var config = ConfigManager.Instance.GetTemplate<BossHomeConfig>(model.selectedBoss); |
| | | var npcConfig = ConfigManager.Instance.GetTemplate<NPCConfig>(model.selectedBoss); |
| | | switch (config.MonsterType) |
| | | { |
| | | case 1: |
| | | m_KillRecord.gameObject.SetActive(false); |
| | | m_BossIntroduce.gameObject.SetActive(false); |
| | | m_ContainerMonster.gameObject.SetActive(true); |
| | | m_BossIntroduce.Dispose(); |
| | | UI3DModelExhibition.Instance.BeginShowNPC(model.selectedBoss, Vector3.zero, m_MonsterPortrait); |
| | | m_MonsterLevel.text = Language.Get("Z1024", npcConfig.NPCLV); |
| | | break; |
| | | case 2: |
| | | m_KillRecord.gameObject.SetActive(true); |
| | | m_BossIntroduce.gameObject.SetActive(true); |
| | | m_BossIntroduce.Display(model.selectedBoss, true); |
| | | m_ContainerMonster.gameObject.SetActive(false); |
| | | m_Subscribe.isOn = findPreciousModel.IsBossSubscribed(model.selectedBoss); |
| | | break; |
| | | } |
| | | |
| | | var npcDropConfig = ConfigManager.Instance.GetTemplate<NPCDropItemConfig>(model.selectedBoss); |
| | | m_SurpassLevel.gameObject.SetActive(npcDropConfig.MaxLV != 0 && PlayerDatas.Instance.baseData.LV > npcDropConfig.MaxLV); |
| | | DisplayItemDropTip(model.selectedBoss); |
| | | DisplayBossBaseInfo(model.selectedBoss); |
| | | DisplayWearyValue(model.selectedBoss); |
| | | } |
| | | |
| | | private void ShowKillRecords() |
| | |
| | | |
| | | private void OnBossSelected(int _bossId) |
| | | { |
| | | var config = ConfigManager.Instance.GetTemplate<BossHomeConfig>(_bossId); |
| | | var npcDropConfig = ConfigManager.Instance.GetTemplate<NPCDropItemConfig>(_bossId); |
| | | m_SurpassLevel.gameObject.SetActive(npcDropConfig.MaxLV != 0 && PlayerDatas.Instance.baseData.LV > npcDropConfig.MaxLV); |
| | | DisplayItemDropTip(_bossId); |
| | | DisplayBossBaseInfo(_bossId); |
| | | DisplayWearyValue(_bossId); |
| | | } |
| | | |
| | | private void DisplayBossBaseInfo(int _bossId) |
| | | { |
| | | var config = ConfigManager.Instance.GetTemplate<DogzDungeonConfig>(_bossId); |
| | | switch (config.MonsterType) |
| | | { |
| | | case 1: |
| | | m_KillRecord.gameObject.SetActive(false); |
| | | m_BossIntroduce.gameObject.SetActive(false); |
| | | m_ContainerMonster.gameObject.SetActive(true); |
| | | m_BossIntroduce.Dispose(); |
| | | UI3DModelExhibition.Instance.BeginShowNPC(_bossId, Vector3.zero, m_MonsterPortrait); |
| | | var npcConfig = ConfigManager.Instance.GetTemplate<NPCConfig>(_bossId); |
| | | m_MonsterLevel.text = Language.Get("Z1024", npcConfig.NPCLV); |
| | | m_BossIntroduce.gameObject.SetActive(false); |
| | | m_EliteMonsterBehaviour.Dispose(); |
| | | m_EliteMonsterBehaviour.gameObject.SetActive(false); |
| | | m_BoxBehaviour.gameObject.SetActive(true); |
| | | m_BoxBehaviour.Display(); |
| | | break; |
| | | case 2: |
| | | if (m_BossIntroduce.gameObject.activeInHierarchy) |
| | | { |
| | | m_BossIntroduce.Display(_bossId, false); |
| | | } |
| | | else |
| | | { |
| | | m_BossIntroduce.gameObject.SetActive(true); |
| | | m_BossIntroduce.Display(_bossId, true); |
| | | } |
| | | m_KillRecord.gameObject.SetActive(false); |
| | | m_BossIntroduce.Dispose(); |
| | | m_BossIntroduce.gameObject.SetActive(false); |
| | | m_BoxBehaviour.gameObject.SetActive(false); |
| | | m_BoxBehaviour.Dispose(); |
| | | |
| | | m_EliteMonsterBehaviour.gameObject.SetActive(true); |
| | | m_EliteMonsterBehaviour.Display(); |
| | | break; |
| | | case 3: |
| | | case 4: |
| | | |
| | | m_KillRecord.gameObject.SetActive(true); |
| | | m_ContainerMonster.gameObject.SetActive(false); |
| | | m_BoxBehaviour.Dispose(); |
| | | m_BoxBehaviour.gameObject.SetActive(false); |
| | | m_EliteMonsterBehaviour.Dispose(); |
| | | m_EliteMonsterBehaviour.gameObject.SetActive(false); |
| | | |
| | | m_BossIntroduce.gameObject.SetActive(true); |
| | | m_BossIntroduce.Display(_bossId, true); |
| | | m_Subscribe.isOn = findPreciousModel.IsBossSubscribed(_bossId); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | private void DisplayItemDropTip(int _bossId) |
| | | { |
| | | var config = ConfigManager.Instance.GetTemplate<DogzDungeonConfig>(model.selectedBoss); |
| | | switch (config.MonsterType) |
| | | { |
| | | case 1: |
| | | case 2: |
| | | m_SurpassLevel.gameObject.SetActive(false); |
| | | break; |
| | | case 3: |
| | | case 4: |
| | | var npcDropConfig = ConfigManager.Instance.GetTemplate<NPCDropItemConfig>(_bossId); |
| | | m_SurpassLevel.gameObject.SetActive(npcDropConfig.MaxLV != 0 && PlayerDatas.Instance.baseData.LV > npcDropConfig.MaxLV); |
| | | m_SurpassLevel.gameObject.SetActive(true); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | private void DisplayWearyValue(int _bossId) |
| | | { |
| | | var config = ConfigManager.Instance.GetTemplate<DogzDungeonConfig>(model.selectedBoss); |
| | | switch (config.MonsterType) |
| | | { |
| | | case 1: |
| | | m_ContainerBoxCollectWeary.gameObject.SetActive(true); |
| | | m_ContainerBossKillWeary.gameObject.SetActive(false); |
| | | var bigBoxCollectCountLimit = 2; |
| | | m_BossKillWearyValue.text = StringUtility.Contact(model.wearyValue, "/", bigBoxCollectCountLimit); |
| | | m_BossKillWearyValue.colorType = model.bigBoxCollectCount >= bigBoxCollectCountLimit ? TextColType.Red : TextColType.DarkGreen; |
| | | break; |
| | | case 2: |
| | | case 3: |
| | | case 4: |
| | | m_ContainerBoxCollectWeary.gameObject.SetActive(false); |
| | | m_ContainerBossKillWeary.gameObject.SetActive(true); |
| | | var wearyValueLimit = GeneralConfig.Instance.bossWearyValues[1]; |
| | | m_BossKillWearyValue.text = StringUtility.Contact(model.wearyValue, "/", wearyValueLimit); |
| | | m_BossKillWearyValue.colorType = model.wearyValue >= wearyValueLimit ? TextColType.Red : TextColType.DarkGreen; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | private void EnterDogzDungeon() |
| | | { |
| | | var error = 0; |