//-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Wednesday, July 04, 2018 //-------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using TableConfig; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { public class FirstChargeTrialBehaviour:MonoBehaviour { [SerializeField] GameObject m_FirstChargeTrialObj; [SerializeField] ItemCell m_ItemCell; [SerializeField] Button m_Btn_Close; [SerializeField] Button m_Btn_PutOn; FirstTimeRechargeModel firstTimeRechargeModel { get { return ModelCenter.Instance.GetModel(); } } private void OnEnable() { m_Btn_Close.AddListener(CloseButton); m_Btn_PutOn.AddListener(PutOnClock); var job = PlayerDatas.Instance.baseData.Job; if (firstTimeRechargeModel.TryOutDic.ContainsKey(job)) { int _weaponId = firstTimeRechargeModel.TryOutDic[job]; ItemCellModel ItemModel = new ItemCellModel(_weaponId, true, 0, 1); m_ItemCell.Init(ItemModel); } } private void OnDisable() { m_Btn_Close.RemoveAllListeners(); m_Btn_Close.RemoveAllListeners(); } private void CloseButton() { m_FirstChargeTrialObj.SetActive(false); firstTimeRechargeModel.IsTipShow = false; } private void PutOnClock() { WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.FirstRecharge); firstTimeRechargeModel.IsTipShow = false; } } }