| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using TableConfig; |
| | | using System.Collections.Generic; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | public class TreasureRefineSuccessWin : Window |
| | | { |
| | | private Text _addFightingText; |
| | | private Text _refineLvText; |
| | | private Text _openSkillText; |
| | | |
| | | private int _addFighting; |
| | | private Treasure _treasure; |
| | | private TreasureConfig _tagTreasureModel; |
| | | private TreasureRefineConfig _refineModel; |
| | | private PlayerPropertyConfig _propertyModel; |
| | | private FuncConfigConfig _tagFuncModel; |
| | | private SkillConfig tagChinSkill; |
| | | |
| | | BlastFurnaceModel _furnaceModel; |
| | | BlastFurnaceModel FurnaceModel |
| | | { |
| | | get |
| | | { |
| | | return _furnaceModel ?? (_furnaceModel = ModelCenter.Instance.GetModel<BlastFurnaceModel>()); |
| | | } |
| | | } |
| | | |
| | | #region 实现抽象类 |
| | | protected override void BindController() |
| | | { |
| | | _tagFuncModel = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("FightpowerFormula"); |
| | | _addFightingText = transform.Find("AddFightingText").GetComponent<Text>(); |
| | | _refineLvText = transform.Find("RefineLvText").GetComponent<Text>(); |
| | | _openSkillText = transform.Find("OpenSkillText").GetComponent<Text>(); |
| | | |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | _treasure = FurnaceModel.treasureData; |
| | | if(_treasure != null) |
| | | { |
| | | _refineModel = TreasureRefineConfig.GetTreasureRefineModel(_treasure.id, _treasure.level); |
| | | _tagTreasureModel = ConfigManager.Instance.GetTemplate<TreasureConfig>(_treasure.id); |
| | | InitUI(); |
| | | } |
| | | |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | |
| | | } |
| | | |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | public void InitUI() |
| | | { |
| | | |
| | | _addFightingText.text = Language.Get("BlastFurnace108",GetAddFighting()); |
| | | if(_tagTreasureModel != null) |
| | | { |
| | | _refineLvText.text = Language.Get("BlastFurnace109",_tagTreasureModel.Name,_treasure.level); |
| | | } |
| | | if(_refineModel != null) |
| | | { |
| | | if(_refineModel.OpenSkill != 0) |
| | | { |
| | | _openSkillText.gameObject.SetActive(true); |
| | | tagChinSkill = ConfigManager.Instance.GetTemplate<SkillConfig>(_refineModel.OpenSkill); |
| | | if(tagChinSkill != null) |
| | | { |
| | | _openSkillText.text = Language.Get("BlastFurnace110",tagChinSkill.SkillName); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | _openSkillText.gameObject.SetActive(false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | _openSkillText.gameObject.SetActive(false); |
| | | } |
| | | Invoke("CloseWin", 2); |
| | | } |
| | | |
| | | private int[] attrIds; |
| | | private int[] attrValues; |
| | | private Dictionary<string, string> _attrDict = new Dictionary<string, string>(); |
| | | public string GetAddFighting() |
| | | { |
| | | if (_refineModel == null) |
| | | return ""; |
| | | |
| | | FurnaceModel.SetTreasureRefineModel(_refineModel); |
| | | attrIds = FurnaceModel.attrIDs; |
| | | attrValues = FurnaceModel.attrValues; |
| | | int i = 0; |
| | | _attrDict.Clear(); |
| | | Equation.Instance.Clear(); |
| | | for (i = 0; i < attrIds.Length; i++) |
| | | { |
| | | _propertyModel = ConfigManager.Instance.GetTemplate<PlayerPropertyConfig>(attrIds[i]); |
| | | if (_propertyModel != null) |
| | | { |
| | | Equation.Instance.AddKeyValue(_propertyModel.Parameter, attrValues[i]); |
| | | } |
| | | } |
| | | if (_tagFuncModel != null) |
| | | { |
| | | return Equation.Instance.Eval<int>(_tagFuncModel.Numerical1).ToString(); |
| | | } |
| | | |
| | | return ""; |
| | | } |
| | | |
| | | private void CloseWin() |
| | | { |
| | | Close(); |
| | | } |
| | | } |
| | | } |
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | | using TableConfig;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class TreasureRefineSuccessWin : Window
|
| | | {
|
| | | private Text _addFightingText;
|
| | | private Text _refineLvText;
|
| | | private Text _openSkillText;
|
| | |
|
| | | private int _addFighting;
|
| | | private Treasure _treasure;
|
| | | private TreasureConfig _tagTreasureModel;
|
| | | private TreasureRefineConfig _refineModel;
|
| | | private PlayerPropertyConfig _propertyModel;
|
| | | private FuncConfigConfig _tagFuncModel;
|
| | | private SkillConfig tagChinSkill;
|
| | |
|
| | | BlastFurnaceModel _furnaceModel;
|
| | | BlastFurnaceModel FurnaceModel
|
| | | {
|
| | | get
|
| | | {
|
| | | return _furnaceModel ?? (_furnaceModel = ModelCenter.Instance.GetModel<BlastFurnaceModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | #region 实现抽象类
|
| | | protected override void BindController()
|
| | | {
|
| | | _tagFuncModel = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("FightpowerFormula");
|
| | | _addFightingText = transform.Find("AddFightingText").GetComponent<Text>();
|
| | | _refineLvText = transform.Find("RefineLvText").GetComponent<Text>();
|
| | | _openSkillText = transform.Find("OpenSkillText").GetComponent<Text>();
|
| | | |
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | //_treasure = FurnaceModel.treasureData;
|
| | | //if(_treasure != null)
|
| | | //{
|
| | | // _refineModel = TreasureRefineConfig.GetTreasureRefineModel(_treasure.id, _treasure.level);
|
| | | // _tagTreasureModel = ConfigManager.Instance.GetTemplate<TreasureConfig>(_treasure.id);
|
| | | // InitUI();
|
| | | //}
|
| | | |
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | |
| | | }
|
| | |
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | |
| | | }
|
| | | #endregion
|
| | |
|
| | | public void InitUI()
|
| | | {
|
| | | |
| | | //_addFightingText.text = Language.Get("BlastFurnace108",GetAddFighting());
|
| | | //if(_tagTreasureModel != null)
|
| | | //{
|
| | | // _refineLvText.text = Language.Get("BlastFurnace109",_tagTreasureModel.Name,_treasure.level);
|
| | | //}
|
| | | //if(_refineModel != null)
|
| | | //{
|
| | | // if(_refineModel.OpenSkill != 0)
|
| | | // {
|
| | | // _openSkillText.gameObject.SetActive(true);
|
| | | // tagChinSkill = ConfigManager.Instance.GetTemplate<SkillConfig>(_refineModel.OpenSkill);
|
| | | // if(tagChinSkill != null)
|
| | | // {
|
| | | // _openSkillText.text = Language.Get("BlastFurnace110",tagChinSkill.SkillName);
|
| | | // }
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // _openSkillText.gameObject.SetActive(false);
|
| | | // }
|
| | | //}
|
| | | //else
|
| | | //{
|
| | | // _openSkillText.gameObject.SetActive(false);
|
| | | //}
|
| | | //Invoke("CloseWin", 2);
|
| | | }
|
| | |
|
| | | private int[] attrIds;
|
| | | private int[] attrValues;
|
| | | private Dictionary<string, string> _attrDict = new Dictionary<string, string>();
|
| | | public string GetAddFighting()
|
| | | {
|
| | | if (_refineModel == null)
|
| | | return "";
|
| | |
|
| | | FurnaceModel.SetTreasureRefineModel(_refineModel);
|
| | | attrIds = FurnaceModel.attrIDs;
|
| | | attrValues = FurnaceModel.attrValues;
|
| | | int i = 0;
|
| | | _attrDict.Clear();
|
| | | Equation.Instance.Clear();
|
| | | for (i = 0; i < attrIds.Length; i++)
|
| | | {
|
| | | _propertyModel = ConfigManager.Instance.GetTemplate<PlayerPropertyConfig>(attrIds[i]);
|
| | | if (_propertyModel != null)
|
| | | {
|
| | | Equation.Instance.AddKeyValue(_propertyModel.Parameter, attrValues[i]);
|
| | | }
|
| | | }
|
| | | if (_tagFuncModel != null)
|
| | | {
|
| | | return Equation.Instance.Eval<int>(_tagFuncModel.Numerical1).ToString();
|
| | | }
|
| | |
|
| | | return "";
|
| | | }
|
| | |
|
| | | private void CloseWin()
|
| | | {
|
| | | Close();
|
| | | }
|
| | | }
|
| | | }
|