| New file |
| | |
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class RealmLevelUpBehaviour : MonoBehaviour
|
| | | {
|
| | | [SerializeField] Transform m_ContainerCondition;
|
| | | [SerializeField] RealmUpCondition m_LevelCondition;
|
| | | [SerializeField] RealmUpCondition m_BossCondition;
|
| | | [SerializeField] Transform m_ContainerCost;
|
| | | [SerializeField] ItemBehaviour m_Item;
|
| | | [SerializeField] Button m_LevelUp;
|
| | |
|
| | | int realmLevel = 0;
|
| | |
|
| | | RealmModel model { get { return ModelCenter.Instance.GetModel<RealmModel>(); } }
|
| | |
|
| | | private void Awake()
|
| | | {
|
| | | m_LevelUp.AddListener(OnLevelUp);
|
| | | }
|
| | |
|
| | | public void Display(int realmLevel)
|
| | | {
|
| | | this.realmLevel = realmLevel;
|
| | | var currentRealmLevel = PlayerDatas.Instance.baseData.realmLevel;
|
| | | var isNext = realmLevel == currentRealmLevel + 1;
|
| | | m_ContainerCondition.gameObject.SetActive(isNext);
|
| | | m_ContainerCost.gameObject.SetActive(isNext);
|
| | |
|
| | | if (isNext)
|
| | | {
|
| | | DisplayCondition();
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayCondition()
|
| | | {
|
| | | var config = RealmConfig.Get(realmLevel);
|
| | | m_LevelCondition.DisplayLevel(realmLevel);
|
| | | //m_BossCondition.gameObject.SetActive(config.BossID != 0);
|
| | | if (config.BossID != 0)
|
| | | {
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnLevelUp()
|
| | | {
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | [Serializable]
|
| | | public class RealmUpCondition
|
| | | {
|
| | | [SerializeField] Text m_Condition;
|
| | | [SerializeField] Text m_Progress;
|
| | |
|
| | | public void DisplayLevel(int realmLevel)
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | public void DisplayBoss(int realmLevel)
|
| | | {
|
| | |
|
| | | }
|
| | | }
|
| | | } |
| | | |