Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
7个文件已删除
1 文件已重命名
18个文件已修改
1个文件已添加
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: Fish |
| | | // [ Date ]: Thursday, February 14, 2019 |
| | | // [ Date ]: Thursday, April 18, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | |
| | | public readonly int level; |
| | | public readonly int attType1; |
| | | public readonly int attMax1; |
| | | public readonly int attCostMoneyMin1; |
| | | public readonly int attCostMoneyMax1; |
| | | public readonly int attCostMoney1; |
| | | public readonly int attType2; |
| | | public readonly int attMax2; |
| | | public readonly int attCostMoneyMin2; |
| | | public readonly int attCostMoneyMax2; |
| | | public readonly int attCostMoney2; |
| | | public readonly int attType3; |
| | | public readonly int attMax3; |
| | | public readonly int attCostMoneyMin3; |
| | | public readonly int attCostMoneyMax3; |
| | | public readonly int attCostMoney3; |
| | | public readonly int costItem; |
| | | public readonly int costCount; |
| | | public readonly string costMoneyList; |
| | |
| | | |
| | | int.TryParse(tables[4],out attMax1); |
| | | |
| | | int.TryParse(tables[5],out attCostMoneyMin1); |
| | | int.TryParse(tables[5],out attCostMoney1); |
| | | |
| | | int.TryParse(tables[6],out attCostMoneyMax1); |
| | | int.TryParse(tables[6],out attType2); |
| | | |
| | | int.TryParse(tables[7],out attType2); |
| | | int.TryParse(tables[7],out attMax2); |
| | | |
| | | int.TryParse(tables[8],out attMax2); |
| | | int.TryParse(tables[8],out attCostMoney2); |
| | | |
| | | int.TryParse(tables[9],out attCostMoneyMin2); |
| | | int.TryParse(tables[9],out attType3); |
| | | |
| | | int.TryParse(tables[10],out attCostMoneyMax2); |
| | | int.TryParse(tables[10],out attMax3); |
| | | |
| | | int.TryParse(tables[11],out attType3); |
| | | int.TryParse(tables[11],out attCostMoney3); |
| | | |
| | | int.TryParse(tables[12],out attMax3); |
| | | int.TryParse(tables[12],out costItem); |
| | | |
| | | int.TryParse(tables[13],out attCostMoneyMin3); |
| | | int.TryParse(tables[13],out costCount); |
| | | |
| | | int.TryParse(tables[14],out attCostMoneyMax3); |
| | | |
| | | int.TryParse(tables[15],out costItem); |
| | | |
| | | int.TryParse(tables[16],out costCount); |
| | | |
| | | costMoneyList = tables[17]; |
| | | costMoneyList = tables[14]; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 19f48e263f005554ba7c2823f723611f |
| | | timeCreated: 1550121162 |
| | | timeCreated: 1555574496 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | translator.DelayWrapLoader(typeof(EquipSuitNameConfig), EquipSuitNameConfigWrap.__Register); |
| | | |
| | | |
| | | translator.DelayWrapLoader(typeof(EquipWashConfig), EquipWashConfigWrap.__Register); |
| | | |
| | | |
| | | translator.DelayWrapLoader(typeof(EquipWashSpecConfig), EquipWashSpecConfigWrap.__Register); |
| | | |
| | | |
| | | translator.DelayWrapLoader(typeof(FaceConfig), FaceConfigWrap.__Register); |
| | | |
| | | |
| | |
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class AlchemyBasicDrugWin : Window
|
| | | public class AlchemyBasicDrugWin : AlchemyDrugWin
|
| | | {
|
| | | [SerializeField] AlchemyScrollBehaviour m_AlchemyScroll;
|
| | | [SerializeField] AlchemyDrugBriefBehaviour m_AlchemyDrug;
|
| | | [SerializeField] AlchemyStudyBehaviour m_AlchemyStudy;
|
| | | [SerializeField] AlchemyBriefBehaviour m_AlchemyBrief;
|
| | | [SerializeField] AlchemyStoveBehaviour m_AlchemyStove;
|
| | |
|
| | | AlchemyModel model { get { return ModelCenter.Instance.GetModel<AlchemyModel>(); } }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | SetDefaultSelect();
|
| | |
|
| | | m_AlchemyScroll.Display((int)AlchemyType.Normal);
|
| | | DisplayAlchmey();
|
| | | m_AlchemyDrug.Display();
|
| | | m_AlchemyStove.Display();
|
| | |
|
| | | model.selectAlchemyRefresh += SelectAlchemyRefresh;
|
| | | model.selectQualityRefresh += SelectQualityRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | m_AlchemyScroll.Dispose();
|
| | | m_AlchemyDrug.Dispose();
|
| | | m_AlchemyStudy.Dispose();
|
| | | m_AlchemyBrief.Dispose();
|
| | | m_AlchemyStove.Dispose();
|
| | |
|
| | | model.selectAlchemyRefresh -= SelectAlchemyRefresh;
|
| | | model.selectQualityRefresh -= SelectQualityRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | void SetDefaultSelect()
|
| | | {
|
| | | var qualities = AlchemyConfig.GetAlchemyQualities((int)AlchemyType.Normal);
|
| | | model.selectQuality = qualities.First();
|
| | |
|
| | | var alchemys = AlchemyConfig.GetAlchemies((int)AlchemyType.Normal, model.selectQuality);
|
| | | model.selectAlchemy = alchemys[0];
|
| | | }
|
| | |
|
| | | private void SelectQualityRefresh()
|
| | | {
|
| | | var alchemys = AlchemyConfig.GetAlchemies((int)AlchemyType.Normal, model.selectQuality);
|
| | | model.selectAlchemy = alchemys[0];
|
| | | }
|
| | |
|
| | | private void SelectAlchemyRefresh()
|
| | | {
|
| | | DisplayAlchmey();
|
| | | }
|
| | |
|
| | | void DisplayAlchmey()
|
| | | {
|
| | | var grasp = model.IsGraspRecipe(model.selectAlchemy);
|
| | | m_AlchemyStudy.gameObject.SetActive(!grasp);
|
| | | m_AlchemyBrief.gameObject.SetActive(grasp);
|
| | |
|
| | | if (grasp)
|
| | | {
|
| | | m_AlchemyStudy.Display();
|
| | | m_AlchemyBrief.Dispose();
|
| | | }
|
| | | else
|
| | | {
|
| | | m_AlchemyBrief.Display();
|
| | | m_AlchemyStudy.Dispose();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Thursday, April 18, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class AlchemyDrugWin : Window
|
| | | {
|
| | | [SerializeField] AlchemyType m_AlchemyType;
|
| | | [SerializeField] AlchemyScrollBehaviour m_AlchemyScroll;
|
| | | [SerializeField] AlchemyDrugBriefBehaviour m_AlchemyDrug;
|
| | | [SerializeField] AlchemyStudyBehaviour m_AlchemyStudy;
|
| | | [SerializeField] AlchemyBriefBehaviour m_AlchemyBrief;
|
| | | [SerializeField] AlchemyStoveBehaviour m_AlchemyStove;
|
| | |
|
| | | AlchemyModel model { get { return ModelCenter.Instance.GetModel<AlchemyModel>(); } }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | model.selectAlchemyType = m_AlchemyType;
|
| | |
|
| | | SetDefaultSelect();
|
| | |
|
| | | m_AlchemyScroll.Display((int)m_AlchemyType);
|
| | | DisplayAlchmey();
|
| | | m_AlchemyDrug.Display();
|
| | | m_AlchemyStove.Display();
|
| | |
|
| | | model.selectAlchemyRefresh += SelectAlchemyRefresh;
|
| | | model.selectQualityRefresh += SelectQualityRefresh;
|
| | | model.alchemyStateRefresh += AlchemyStateRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | m_AlchemyScroll.Dispose();
|
| | | m_AlchemyDrug.Dispose();
|
| | | m_AlchemyStudy.Dispose();
|
| | | m_AlchemyBrief.Dispose();
|
| | | m_AlchemyStove.Dispose();
|
| | |
|
| | | model.selectAlchemyRefresh -= SelectAlchemyRefresh;
|
| | | model.selectQualityRefresh -= SelectQualityRefresh;
|
| | | model.alchemyStateRefresh -= AlchemyStateRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | void SetDefaultSelect()
|
| | | {
|
| | | var qualities = AlchemyConfig.GetAlchemyQualities((int)m_AlchemyType);
|
| | | model.selectQuality = qualities.First();
|
| | |
|
| | | var alchemys = AlchemyConfig.GetAlchemies((int)m_AlchemyType, model.selectQuality);
|
| | | model.selectAlchemy = alchemys[0];
|
| | | }
|
| | |
|
| | | private void SelectQualityRefresh()
|
| | | {
|
| | | var alchemys = AlchemyConfig.GetAlchemies((int)m_AlchemyType, model.selectQuality);
|
| | | model.selectAlchemy = alchemys[0];
|
| | | }
|
| | |
|
| | | private void SelectAlchemyRefresh()
|
| | | {
|
| | | DisplayAlchmey();
|
| | | }
|
| | |
|
| | | private void AlchemyStateRefresh()
|
| | | {
|
| | | DisplayAlchmey();
|
| | | }
|
| | |
|
| | | void DisplayAlchmey()
|
| | | {
|
| | | var grasp = model.IsGraspRecipe(model.selectAlchemy);
|
| | | m_AlchemyStudy.gameObject.SetActive(!grasp);
|
| | | m_AlchemyBrief.gameObject.SetActive(grasp);
|
| | |
|
| | | if (!grasp)
|
| | | {
|
| | | m_AlchemyStudy.Display();
|
| | | m_AlchemyBrief.Dispose();
|
| | | }
|
| | | else
|
| | | {
|
| | | m_AlchemyBrief.Display();
|
| | | m_AlchemyStudy.Dispose();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| File was renamed from Core/GameEngine/Model/TelPartialConfig/tagEquipWashSpecConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 5e689b8cb1014ef4dad115032b7d6012 |
| | | timeCreated: 1502507015 |
| | | guid: ecacfe2835b59a74ab865dcae5030139 |
| | | timeCreated: 1555571188 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class AlchemyFairyDrugWin : Window
|
| | | public class AlchemyFairyDrugWin : AlchemyDrugWin
|
| | | {
|
| | | [SerializeField] AlchemyScrollBehaviour m_AlchemyScroll;
|
| | | [SerializeField] AlchemyDrugBriefBehaviour m_AlchemyDrug;
|
| | | [SerializeField] AlchemyStudyBehaviour m_AlchemyStudy;
|
| | | [SerializeField] AlchemyBriefBehaviour m_AlchemyBrief;
|
| | | [SerializeField] AlchemyStoveBehaviour m_AlchemyStove;
|
| | |
|
| | | AlchemyModel model { get { return ModelCenter.Instance.GetModel<AlchemyModel>(); } }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | SetDefaultSelect();
|
| | |
|
| | | m_AlchemyScroll.Display((int)AlchemyType.Fairy);
|
| | | DisplayAlchmey();
|
| | | m_AlchemyDrug.Display();
|
| | | m_AlchemyStove.Display();
|
| | |
|
| | | model.selectAlchemyRefresh += SelectAlchemyRefresh;
|
| | | model.selectQualityRefresh += SelectQualityRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | m_AlchemyScroll.Dispose();
|
| | | m_AlchemyDrug.Dispose();
|
| | | m_AlchemyStudy.Dispose();
|
| | | m_AlchemyBrief.Dispose();
|
| | | m_AlchemyStove.Dispose();
|
| | |
|
| | | model.selectAlchemyRefresh -= SelectAlchemyRefresh;
|
| | | model.selectQualityRefresh -= SelectQualityRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | void SetDefaultSelect()
|
| | | {
|
| | | var qualities = AlchemyConfig.GetAlchemyQualities((int)AlchemyType.Fairy);
|
| | | model.selectQuality = qualities.First();
|
| | |
|
| | | var alchemys = AlchemyConfig.GetAlchemies((int)AlchemyType.Fairy, model.selectQuality);
|
| | | model.selectAlchemy = alchemys[0];
|
| | | }
|
| | |
|
| | | private void SelectQualityRefresh()
|
| | | {
|
| | | var alchemys = AlchemyConfig.GetAlchemies((int)AlchemyType.Normal, model.selectQuality);
|
| | | model.selectAlchemy = alchemys[0];
|
| | | }
|
| | |
|
| | | private void SelectAlchemyRefresh()
|
| | | {
|
| | | DisplayAlchmey();
|
| | | }
|
| | |
|
| | | void DisplayAlchmey()
|
| | | {
|
| | | var grasp = model.IsGraspRecipe(model.selectAlchemy);
|
| | | m_AlchemyStudy.gameObject.SetActive(!grasp);
|
| | | m_AlchemyBrief.gameObject.SetActive(grasp);
|
| | |
|
| | | if (grasp)
|
| | | {
|
| | | m_AlchemyStudy.Display();
|
| | | m_AlchemyBrief.Dispose();
|
| | | }
|
| | | else
|
| | | {
|
| | | m_AlchemyBrief.Display();
|
| | | m_AlchemyStudy.Dispose();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public AlchemyType selectAlchemyType { get; set; }
|
| | |
|
| | | public int stoveLevel { get; private set; }
|
| | | public int stoveExp { get; private set; }
|
| | | public string alchemySuccRate { get; private set; }
|
| | |
| | | public event Action selectQualityRefresh;
|
| | | public event Action selectAlchemyRefresh;
|
| | | public event Action alchemyStateRefresh;
|
| | |
|
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | |
| | | return Equation.Instance.Eval<float>(alchemySuccRate);
|
| | | }
|
| | |
|
| | | public int GetStoveState(int alchemyId)
|
| | | {
|
| | | uint tick = 0;
|
| | | if (TryGetAlchemyStartTime(alchemyId, out tick)
|
| | | && tick > 0)
|
| | | {
|
| | | var config = AlchemyConfig.Get(alchemyId);
|
| | | var startTime = TimeUtility.GetTime(tick);
|
| | | var seconds = (int)(config.NeedTime - (float)(TimeUtility.ServerNow - startTime).TotalSeconds);
|
| | | return seconds > 0 ? 1 : 2;
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public bool IsGraspRecipe(int alchemyId)
|
| | | {
|
| | | return m_AlchemyTimes.ContainsKey(alchemyId);
|
| | | }
|
| | |
|
| | | public bool IsAlchemyEnoughMaterial(int alchemyId, out Item item)
|
| | | {
|
| | | List<Item> materials;
|
| | | item = default(Item);
|
| | | if (TryGetAlchemyMaterials(alchemyId, out materials))
|
| | | {
|
| | | for (int i = 0; i < materials.Count; i++)
|
| | | {
|
| | | var mat = materials[i];
|
| | | var count = packModel.GetItemCountByID(PackType.Item, mat.id);
|
| | | if (count < mat.count)
|
| | | {
|
| | | item = mat;
|
| | | return false;
|
| | | }
|
| | | }
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | public bool IsStoveAlcheming(AlchemyType alchemyType)
|
| | | {
|
| | | var qualities = AlchemyConfig.GetAlchemyQualities((int)alchemyType);
|
| | | foreach (var quality in qualities)
|
| | | {
|
| | | var alchemys = AlchemyConfig.GetAlchemies((int)alchemyType, quality);
|
| | | foreach (var alchemyId in alchemys)
|
| | | {
|
| | | var state = GetStoveState(alchemyId);
|
| | | if (state != 0)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public void ReceivePackage(HA3BF_tagMCPlayerStoveMsg package)
|
| | | {
|
| | | for (int i = 0; i < package.StoveCnt; i++)
|
| | |
| | |
|
| | | void DisplayRecipes()
|
| | | {
|
| | | m_Controller.Refresh();
|
| | | var qualities = AlchemyConfig.GetAlchemyQualities(alchemyType);
|
| | | foreach (var quality in qualities)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | m_Controller.Restart();
|
| | | }
|
| | |
|
| | | private void OnRefreshCell(ScrollerDataType type, CellView cell)
|
| | |
| | | }
|
| | |
|
| | | AlchemyModel model { get { return ModelCenter.Instance.GetModel<AlchemyModel>(); } }
|
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | |
|
| | | private void Awake()
|
| | | {
|
| | |
| | | GlobalTimeEvent.Instance.secondEvent += PerSecond;
|
| | | model.alchemyStateRefresh += AlchemyStateRefresh;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefreshEvent;
|
| | | packModel.refreshItemCountEvent += RefreshItemCountEvent;
|
| | |
|
| | | m_State = GetStoveState();
|
| | | m_State = model.GetStoveState(model.selectAlchemy);
|
| | |
|
| | | DisplayAlchemyMaterials();
|
| | | DisplayStove();
|
| | |
| | | {
|
| | | if (grasp && materials != null && i < materials.Count)
|
| | | {
|
| | | m_AlchemyMaterials[i].SetLock(true);
|
| | | m_AlchemyMaterials[i].SetLock(false);
|
| | | m_AlchemyMaterials[i].Display(materials[i]);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_AlchemyMaterials[i].SetLock(false);
|
| | | m_AlchemyMaterials[i].SetLock(true);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | m_LuckValue.text = PlayerDatas.Instance.extersion.luckValue.ToString();
|
| | | }
|
| | |
|
| | | int GetStoveState()
|
| | | {
|
| | | uint tick = 0;
|
| | | if (model.TryGetAlchemyStartTime(model.selectAlchemy, out tick)
|
| | | && tick > 0)
|
| | | {
|
| | | var config = AlchemyConfig.Get(model.selectAlchemy);
|
| | | var startTime = TimeUtility.GetTime(tick);
|
| | | var seconds = Mathf.CeilToInt(config.NeedTime - (float)(TimeUtility.ServerNow - startTime).TotalSeconds);
|
| | | return seconds > 0 ? 1 : 2;
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | private void SelectAlchemyRefresh()
|
| | | {
|
| | | m_State = model.GetStoveState(model.selectAlchemy);
|
| | | DisplayStove();
|
| | | DisplayAlchemyMaterials();
|
| | | }
|
| | |
|
| | | private void AlchemyStateRefresh()
|
| | | {
|
| | | m_State = GetStoveState();
|
| | | m_State = model.GetStoveState(model.selectAlchemy);
|
| | | DisplayStove();
|
| | | DisplayAlchemyMaterials();
|
| | | }
|
| | |
|
| | | private void PlayerDataRefreshEvent(PlayerDataType dataType)
|
| | |
| | |
|
| | | private void PerSecond()
|
| | | {
|
| | | var _state = GetStoveState();
|
| | | var _state = model.GetStoveState(model.selectAlchemy);
|
| | |
|
| | | if (_state == state)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | private void OnFunc()
|
| | | {
|
| | | switch (state)
|
| | | {
|
| | | case 0:
|
| | | if (model.IsStoveAlcheming(model.selectAlchemyType))
|
| | | {
|
| | | return;
|
| | | }
|
| | | Item item;
|
| | | if (!model.IsAlchemyEnoughMaterial(model.selectAlchemy, out item))
|
| | | {
|
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(item.id);
|
| | | return;
|
| | | }
|
| | | var succRate = model.GetAlchemySuccRate(model.selectAlchemy);
|
| | | if (succRate / 100 < 100)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), "", (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | SendAlchemyPackage();
|
| | | }
|
| | | });
|
| | | return;
|
| | | }
|
| | | break;
|
| | | }
|
| | |
|
| | | SendAlchemyPackage();
|
| | | }
|
| | |
|
| | | void SendAlchemyPackage()
|
| | | {
|
| | | var pak = new CA576_tagCMPlayerRefine();
|
| | | pak.AlchemyID = (uint)model.selectAlchemy;
|
| | |
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | |
|
| | | private void RefreshItemCountEvent(PackType packType, int index, int itemId)
|
| | | {
|
| | | if (packType == PackType.Item)
|
| | | {
|
| | | List<Item> items;
|
| | | if (model.TryGetAlchemyMaterials(model.selectAlchemy, out items))
|
| | | {
|
| | | if (items.FindIndex((x) =>
|
| | | {
|
| | | return x.id == itemId;
|
| | | }) != -1)
|
| | | {
|
| | | DisplayAlchemyMaterials();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void Dispose()
|
| | | {
|
| | | model.selectAlchemyRefresh -= SelectAlchemyRefresh;
|
| | | GlobalTimeEvent.Instance.secondEvent -= PerSecond;
|
| | | model.alchemyStateRefresh -= AlchemyStateRefresh;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefreshEvent;
|
| | | packModel.refreshItemCountEvent -= RefreshItemCountEvent;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | [SerializeField] Image m_Icon;
|
| | | [SerializeField] Text m_Count;
|
| | | [SerializeField] Transform m_ContainerLock;
|
| | | [SerializeField] Button m_Func;
|
| | |
|
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | |
|
| | |
| | | var enough = packCount >= count;
|
| | | var label = UIHelper.AppendColor(enough ? TextColType.Green : TextColType.Red, packCount.ToString());
|
| | | m_Count.text = StringUtility.Contact(label, "/", count);
|
| | |
|
| | | m_Func.SetListener(() =>
|
| | | {
|
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(id);
|
| | | });
|
| | | }
|
| | |
|
| | | public void SetLock(bool _lock)
|
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using System; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | |
| | | public readonly LogicList<EquipTrainCandidate> candidatePlaces = new LogicList<EquipTrainCandidate>(); |
| | | public readonly LogicList<EquipTrainPropertyBar> propertyBars = new LogicList<EquipTrainPropertyBar>(); |
| | | public readonly LogicBool trainLimit = new LogicBool(); |
| | | public readonly LogicInt trainEffect = new LogicInt(); |
| | | |
| | | static Dictionary<int, int> trainTypes = new Dictionary<int, int>(); |
| | | Dictionary<int, EquipTrainSet> equipTrains = new Dictionary<int, EquipTrainSet>(); |
| | |
| | | equipTrainMaxLevel.value = 0; |
| | | material.value = Int3.zero; |
| | | inevitableMaterialCount.value = 0; |
| | | trainEffect.value = 0; |
| | | operateType.value = TrainOperateType.None; |
| | | candidatePlaces.Clear(); |
| | | propertyBars.Clear(); |
| | |
| | | code += inevitables[i] ? MathUtility.Power(2, i) : 0; |
| | | } |
| | | |
| | | Action processTrain = () => |
| | | { |
| | | trainEffect.dirty = true; |
| | | trainEffect.value = code > 0 ? 2 : 1; |
| | | |
| | | var equipWash = new CA325_tagCMEquipXLAttrChange(); |
| | | equipWash.EquipPlace = (byte)EquipSet.ClientPlaceToServerPlace(equipPosition); |
| | | equipWash.CheckUseGoldAttr = (byte)code; |
| | | GameNetSystem.Instance.SendInfo(equipWash); |
| | | }; |
| | | |
| | | if (inevitableCount > 0) |
| | | { |
| | | var trainLevel = GetTrainLevel(equipPosition); |
| | |
| | | DayRemind.Instance.SetDayRemind(DayRemind.EQUIPTRAIN_COSTDIAMOND, true); |
| | | } |
| | | |
| | | if (!ok) |
| | | if (ok) |
| | | { |
| | | return; |
| | | processTrain(); |
| | | } |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | processTrain(); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | processTrain(); |
| | | } |
| | | |
| | | var equipWash = new CA325_tagCMEquipXLAttrChange(); |
| | | equipWash.EquipPlace = (byte)EquipSet.ClientPlaceToServerPlace(equipPosition); |
| | | equipWash.CheckUseGoldAttr = (byte)code; |
| | | GameNetSystem.Instance.SendInfo(equipWash); |
| | | } |
| | | |
| | | public void Save(Int2 equipPosition) |
| | |
| | | |
| | | if (data != null) |
| | | { |
| | | var propertyBar = new EquipTrainPropertyBar(data.config.attType1, data.config.attMax1, trainState); |
| | | var propertyBar = new EquipTrainPropertyBar(data.config.attType1, data.config.attMax1, data.config.attCostMoney1, trainState); |
| | | propertyBar.propertyValue.value = trainedProperties.x; |
| | | propertyBar.deltaValue.value = unSavedProperties.x; |
| | | propertyBar.operateType.value = operateType; |
| | | propertyBars.Add(propertyBar); |
| | | |
| | | propertyBar = new EquipTrainPropertyBar(data.config.attType2, data.config.attMax2, trainState); |
| | | propertyBar = new EquipTrainPropertyBar(data.config.attType2, data.config.attMax2, data.config.attCostMoney2, trainState); |
| | | propertyBar.propertyValue.value = trainedProperties.y; |
| | | propertyBar.deltaValue.value = unSavedProperties.y; |
| | | propertyBar.operateType.value = operateType; |
| | | propertyBars.Add(propertyBar); |
| | | |
| | | propertyBar = new EquipTrainPropertyBar(data.config.attType3, data.config.attMax3, trainState); |
| | | propertyBar = new EquipTrainPropertyBar(data.config.attType3, data.config.attMax3, data.config.attCostMoney3, trainState); |
| | | propertyBar.propertyValue.value = trainedProperties.z; |
| | | propertyBar.deltaValue.value = unSavedProperties.z; |
| | | propertyBar.operateType.value = operateType; |
| | |
| | | { |
| | | public readonly int propertyId; |
| | | public readonly int upperLimit; |
| | | public readonly int deltaMax; |
| | | public readonly EquipTrainModel.TrainState trainState; |
| | | public readonly LogicInt propertyValue = new LogicInt(); |
| | | public readonly LogicInt deltaValue = new LogicInt(); |
| | |
| | | public readonly LogicEnum<EquipTrainModel.TrainOperateType> operateType |
| | | = new LogicEnum<EquipTrainModel.TrainOperateType>(EquipTrainModel.TrainOperateType.None); |
| | | |
| | | public EquipTrainPropertyBar(int propertyId, int upperLimit, EquipTrainModel.TrainState trainState) |
| | | public EquipTrainPropertyBar(int propertyId, int upperLimit, int detalMax, EquipTrainModel.TrainState trainState) |
| | | { |
| | | this.propertyId = propertyId; |
| | | this.upperLimit = upperLimit; |
| | | this.deltaMax = detalMax; |
| | | this.trainState = trainState; |
| | | } |
| | | |
| | |
| | | [SerializeField] Text m_PropertyName; |
| | | [SerializeField] Text m_Value; |
| | | [SerializeField] Slider m_Progress; |
| | | [SerializeField] Text m_DeltaValueMax; |
| | | [SerializeField] Text m_DeltaValue; |
| | | [SerializeField] ToggleButton m_Inevitable; |
| | | |
| | |
| | | m_Progress.value = 0; |
| | | m_Value.text = "0"; |
| | | m_DeltaValue.gameObject.SetActive(false); |
| | | m_DeltaValueMax.gameObject.SetActive(false); |
| | | m_Inevitable.gameObject.SetActive(true); |
| | | break; |
| | | case EquipTrainModel.TrainState.StarLimit: |
| | | m_Progress.value = 1; |
| | | m_Value.text = string.Format("{0}/{1}", propertyBar.propertyValue, propertyBar.upperLimit); |
| | | m_DeltaValue.gameObject.SetActive(true); |
| | | m_DeltaValueMax.gameObject.SetActive(true); |
| | | m_Inevitable.gameObject.SetActive(true); |
| | | break; |
| | | case EquipTrainModel.TrainState.MaxLevel: |
| | | m_Progress.value = 1; |
| | | m_Value.text = string.Format("{0}/{1}", propertyBar.propertyValue, propertyBar.upperLimit); |
| | | m_DeltaValue.gameObject.SetActive(true); |
| | | m_DeltaValueMax.gameObject.SetActive(true); |
| | | m_Inevitable.gameObject.SetActive(false); |
| | | break; |
| | | case EquipTrainModel.TrainState.Allowable: |
| | | m_Inevitable.gameObject.SetActive(true); |
| | | m_DeltaValue.gameObject.SetActive(true); |
| | | m_DeltaValueMax.gameObject.SetActive(true); |
| | | break; |
| | | } |
| | | |
| | |
| | | var isPerfect = propertyBar.upperLimit > 0 && propertyBar.propertyValue.value >= propertyBar.upperLimit; |
| | | if (isPerfect) |
| | | { |
| | | m_DeltaValueMax.text = ""; |
| | | m_DeltaValue.text = "完美"; |
| | | m_DeltaValue.color = UIHelper.GetUIColor(TextColType.Green, true); |
| | | } |
| | |
| | | { |
| | | m_DeltaValue.text = inevitable ? "最大" : ""; |
| | | m_DeltaValue.color = UIHelper.GetUIColor(TextColType.Green, true); |
| | | m_DeltaValueMax.text = inevitable ? string.Format("+{0}", propertyBar.deltaMax) : ""; |
| | | } |
| | | else if (operateType == EquipTrainModel.TrainOperateType.Save) |
| | | { |
| | | m_DeltaValueMax.text = ""; |
| | | if (deltaValue > 0) |
| | | { |
| | | m_DeltaValue.text = string.Format("+{0}", deltaValue); |
| | |
| | | } |
| | | else |
| | | { |
| | | m_DeltaValueMax.text = ""; |
| | | m_DeltaValue.text = ""; |
| | | } |
| | | } |
| | |
| | | [SerializeField] EquipTrainPropertyBarBehaviour[] m_PropertyBarBehaviours; |
| | | [SerializeField] RectTransform m_MaxLevelContainer; |
| | | |
| | | [SerializeField] UIEffect m_EffectNormal; |
| | | [SerializeField] UIEffect m_EffectMust; |
| | | |
| | | [SerializeField] Button m_Train; |
| | | [SerializeField] Button m_Save; |
| | | [SerializeField] Button m_GiveUp; |
| | |
| | | m_EquipEmpty.gameObject.SetActive(false); |
| | | m_TargetEquip.gameObject.SetActive(true); |
| | | m_TargetEquip.Init(equip); |
| | | m_TargetEquip.button.SetListener(ViewEquipTip); |
| | | |
| | | var starLevel = starModel.GetEquipStarLevel(equipPosition); |
| | | m_EquipStar.gameObject.SetActive(true); |
| | |
| | | DisplayProperty(model.propertyBars.Fetch()); |
| | | } |
| | | |
| | | if (force || model.trainEffect.dirty) |
| | | { |
| | | DisplayTrainEffect(model.trainEffect.Fetch()); |
| | | } |
| | | |
| | | } |
| | | |
| | | private void DisplayMaterial(Int3 material) |
| | |
| | | m_UpdateLevel.gameObject.SetActive(opreateType == EquipTrainModel.TrainOperateType.LevelUp); |
| | | } |
| | | |
| | | private void DisplayTrainEffect(int value) |
| | | { |
| | | switch (value) |
| | | { |
| | | case 1: |
| | | m_EffectNormal.Play(); |
| | | break; |
| | | case 2: |
| | | m_EffectMust.Play(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | private void Train() |
| | | { |
| | | var equipPosition = new Int2(model.selectedLevel.value, model.selectedPlace.value); |
| | |
| | | model.UpdateLevel(equipPosition); |
| | | } |
| | | |
| | | private void ViewEquipTip() |
| | | { |
| | | var level = model.selectedLevel.value; |
| | | var place = model.selectedPlace.value; |
| | | var equipPosition = new Int2(level, place); |
| | | var equipGuid = equipModel.GetEquip(equipPosition); |
| | | |
| | | var itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>(); |
| | | itemTipsModel.SetItemTipsModel(PackType.Item, equipGuid, false, true); |
| | | itemTipsModel.ShowTip(); |
| | | } |
| | | |
| | | private void CreateLevelBehaviours() |
| | | { |
| | | var levels = equipModel.GetUnLockedEquipSets(); |
| | |
| | | public class HazyDemonKingModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | Dictionary<uint, HazyDemonKingPlayerInfo> m_PlayerInfos = new Dictionary<uint, HazyDemonKingPlayerInfo>();
|
| | | List<uint> m_AttackHeroPlayers = new List<uint>();
|
| | |
|
| | | public bool IsInDungeon { get; private set; }
|
| | |
|
| | |
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | |
|
| | | GA_Hero.OnStartBeAttacked -= OnStartBeAttacked;
|
| | | GA_Hero.OnStopBeAttacked -= OnStopBeAttacked;
|
| | |
|
| | | m_AttackHeroPlayers.Clear();
|
| | |
|
| | | IsInDungeon = false;
|
| | | if (IsInDemonKingDungeon(mapId))
|
| | | {
|
| | | IsInDungeon = true;
|
| | | RefreshAroundPlayer();
|
| | |
|
| | | GA_Hero.OnStartBeAttacked += OnStartBeAttacked;
|
| | | GA_Hero.OnStopBeAttacked += OnStopBeAttacked;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnStopBeAttacked(uint sid)
|
| | | {
|
| | | if (m_AttackHeroPlayers.Contains(sid))
|
| | | {
|
| | | m_AttackHeroPlayers.Remove(sid);
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnStartBeAttacked(uint sid)
|
| | | {
|
| | | if (!m_AttackHeroPlayers.Contains(sid))
|
| | | {
|
| | | m_AttackHeroPlayers.Add(sid);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public uint GetPlayerAtkTarget(uint serverInstId)
|
| | | public uint GetPlayerAtkTarget(uint sid)
|
| | | {
|
| | | if (ClientDungeonStageUtility.clientMapId == Client_MapID)
|
| | | {
|
| | | return ClientHazyDemonKingStage.GetClientBossSid();
|
| | | }
|
| | | if (serverInstId == PlayerDatas.Instance.PlayerId)
|
| | | if (sid == PlayerDatas.Instance.PlayerId)
|
| | | {
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | if (hero != null && hero.SelectTarget != null)
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | |
|
| | | if (m_AttackHeroPlayers.Contains(sid))
|
| | | {
|
| | | return PlayerDatas.Instance.PlayerId;
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
| | |
|
| | | void DisplayGrassCount()
|
| | | {
|
| | | var mapId = hazyGrassModel.GetGrassMapId(hazyRegionModel.processingIncidentId);
|
| | | var mapId = 0;
|
| | | if (ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | mapId = hazyGrassModel.GetGrassMapId(hazyRegionModel.processingIncidentId);
|
| | | }
|
| | | else
|
| | | {
|
| | | mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | }
|
| | | var npcInfos = hazyGrassModel.GetGrassNpcInfos(mapId);
|
| | | for (int i = 0; i < m_GrassCountBehas.Length; i++)
|
| | | {
|
| | |
| | |
|
| | | void DisplayGrassRefreshTime()
|
| | | {
|
| | | var mapId = hazyGrassModel.GetGrassMapId(hazyRegionModel.processingIncidentId);
|
| | | var mapId = 0;
|
| | | if (ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | mapId = hazyGrassModel.GetGrassMapId(hazyRegionModel.processingIncidentId);
|
| | | }
|
| | | else
|
| | | {
|
| | | mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | }
|
| | | var npcInfos = hazyGrassModel.GetGrassNpcInfos(mapId);
|
| | | for (int i = 0; i < m_GrassTimes.Length; i++)
|
| | | {
|
| | | if (npcInfos != null && i < npcInfos.Count)
|
| | | {
|
| | | m_GrassTimes[i].gameObject.SetActive(true);
|
| | | var used = TimeUtility.Minute * 60 + TimeUtility.Second;
|
| | | var used = 0;
|
| | | if (ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | used = TimeUtility.Minute * 60 + TimeUtility.Second;
|
| | | }
|
| | | else
|
| | | {
|
| | | used = TimeUtility.CrossServerNow.Minute * 60 + TimeUtility.CrossServerNow.Second;
|
| | | }
|
| | | var refreshSeconds = npcInfos[i].refreshMinute * 60;
|
| | | var seconds = refreshSeconds - used % refreshSeconds;
|
| | | var npcConfig = NPCConfig.Get(npcInfos[i].npcId);
|
| | |
| | | {
|
| | | if (!ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
|
| | | if (config != null)
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var npcInfos = hazyGrassModel.GetGrassNpcInfos(mapId);
|
| | | if (npcInfos != null)
|
| | | {
|
| | | var npcInfos = hazyGrassModel.GetGrassNpcInfos(config.dungeonId);
|
| | | if (npcInfos != null)
|
| | | int[] npcs = new int[npcInfos.Count];
|
| | | for (int i = 0; i < npcInfos.Count; i++)
|
| | | {
|
| | | int[] npcs = new int[npcInfos.Count];
|
| | | for (int i = 0; i < npcInfos.Count; i++)
|
| | | {
|
| | | npcs[i] = npcInfos[i].npcId;
|
| | | }
|
| | |
|
| | | var pak = new CA227_tagCMQueryNPCCntInfo();
|
| | | pak.MapID = (uint)config.dungeonId;
|
| | | pak.LineID = (ushort)config.lineId;
|
| | | pak.NPCIDList = LitJson.JsonMapper.ToJson(npcs);
|
| | | pak.NPCIDListLen = (byte)pak.NPCIDList.Length;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | npcs[i] = npcInfos[i].npcId;
|
| | | }
|
| | |
|
| | | var pak = new CA227_tagCMQueryNPCCntInfo();
|
| | | pak.MapID = (uint)mapId;
|
| | | pak.LineID = (ushort)PlayerDatas.Instance.baseData.dungeonLineId;
|
| | | pak.NPCIDList = LitJson.JsonMapper.ToJson(npcs);
|
| | | pak.NPCIDListLen = (byte)pak.NPCIDList.Length;
|
| | | GameNetSystem.Instance.SendToCrossServer(pak);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | public class HazyRegionIncidentBehaviour : ScrollItem
|
| | | {
|
| | | [SerializeField] SmoothMask m_SmoothMask;
|
| | | [SerializeField] UIAlphaTween m_AlphaTween;
|
| | | [SerializeField] UILinerMove m_LinerMove;
|
| | | [SerializeField] Text m_IncidentTitle;
|
| | | [SerializeField] Text m_DepletionPoint;
|
| | | [SerializeField] Image m_Icon;
|
| | | [SerializeField] ImageEx m_Icon;
|
| | |
|
| | | [SerializeField] Transform m_ContainerCrossServer;
|
| | |
|
| | |
| | | public UILinerMove linerMove { get { return m_LinerMove; } }
|
| | |
|
| | | HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
|
| | | FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } }
|
| | |
|
| | | int incidentId = 0;
|
| | |
|
| | | bool m_BossAlive = false;
|
| | | bool bossAlive
|
| | | {
|
| | | get { return m_BossAlive; }
|
| | | set
|
| | | {
|
| | | if (m_BossAlive != value)
|
| | | {
|
| | | m_BossAlive = value;
|
| | | DisplayBossState();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | float timer = 0f;
|
| | |
|
| | | HazyRegionIncidentType incidentType = HazyRegionIncidentType.Adventure;
|
| | |
|
| | |
| | | var config = HazyRegionConfig.Get(incidentId);
|
| | | incidentType = (HazyRegionIncidentType)config.incidentType;
|
| | |
|
| | | if (incidentType == HazyRegionIncidentType.DemonKing)
|
| | | {
|
| | | m_BossAlive = findPreciousModel.IsBossAlive(config.npcId);
|
| | | }
|
| | |
|
| | | DisplayBase();
|
| | | DisplayItems();
|
| | | DisplayState();
|
| | |
| | | model.selectIncidentRefresh += SelectIncidentRefresh;
|
| | | model.onHazyRegionIncidentRefresh -= OnHazyRegionIncidentRefresh;
|
| | | model.onHazyRegionIncidentRefresh += OnHazyRegionIncidentRefresh;
|
| | | findPreciousModel.bossInfoUpdateEvent -= BossInfoUpdateEvent;
|
| | | findPreciousModel.bossInfoUpdateEvent += BossInfoUpdateEvent;
|
| | | }
|
| | |
|
| | | void DisplayBase()
|
| | |
| | | m_IncidentTitle.text = config.name;
|
| | | m_Icon.SetSprite(config.PortraitID);
|
| | | m_Icon.SetNativeSize();
|
| | | m_Icon.material = m_SmoothMask.imageMaterials[0];
|
| | | m_ContainerCrossServer.gameObject.SetActive(config.crossServer == 1);
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | m_PlayerCount.gameObject.SetActive(false);
|
| | | m_RebornTime.gameObject.SetActive(false);
|
| | | var config = HazyRegionConfig.Get(incidentId);
|
| | | m_PlayerCount.gameObject.SetActive(bossAlive);
|
| | | m_RebornTime.gameObject.SetActive(!bossAlive);
|
| | | m_Icon.material = bossAlive ? m_SmoothMask.imageMaterials[0] : m_SmoothMask.imageMaterials[1];
|
| | | if (!bossAlive)
|
| | | {
|
| | | DisplayBossRebornTime();
|
| | | }
|
| | | else
|
| | | {
|
| | | m_PlayerCount.text = Language.Get("HazyDemonKingPlayerCount", 0);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayBossRebornTime()
|
| | | {
|
| | | var config = HazyRegionConfig.Get(incidentId);
|
| | | if (config != null)
|
| | | {
|
| | | FindPreciousModel.BossInfo bossInfo;
|
| | | if (findPreciousModel.TryGetBossInfo(config.npcId, out bossInfo))
|
| | | {
|
| | | var seconds = Mathf.Max(0, Mathf.CeilToInt((float)(bossInfo.refreshTime - TimeUtility.ServerNow).TotalSeconds));
|
| | | m_RebornTime.text = string.Format("{0}后刷新", TimeUtility.SecondsToHMS(seconds));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void LateUpdate()
|
| | | {
|
| | | timer += Time.deltaTime;
|
| | | if (timer >= 0.5f)
|
| | | {
|
| | | timer = 0f;
|
| | | if (incidentType == HazyRegionIncidentType.DemonKing)
|
| | | {
|
| | | if (!bossAlive)
|
| | | {
|
| | | DisplayBossRebornTime();
|
| | | }
|
| | |
|
| | | var config = HazyRegionConfig.Get(incidentId);
|
| | | bossAlive = findPreciousModel.IsBossAlive(config.npcId);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | model.selectIncident = incidentId;
|
| | | }
|
| | |
|
| | | private void BossInfoUpdateEvent(int npcId)
|
| | | {
|
| | | if (incidentType == HazyRegionIncidentType.DemonKing)
|
| | | {
|
| | | var config = HazyRegionConfig.Get(incidentId);
|
| | | if (config.npcId == npcId)
|
| | | {
|
| | | DisplayBossState();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public override void Dispose()
|
| | | {
|
| | | base.Dispose();
|
| | | findPreciousModel.bossInfoUpdateEvent -= BossInfoUpdateEvent;
|
| | | model.selectIncidentRefresh -= SelectIncidentRefresh;
|
| | | model.onHazyRegionIncidentRefresh -= OnHazyRegionIncidentRefresh;
|
| | | }
|
| | |
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | |
| | | normalTasks.Add(new ConfigInitTask("EquipGSParamConfig", () => { EquipGSParamConfig.Init(); }, () => { return EquipGSParamConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("EquipSuitAttrConfig", () => { EquipSuitAttrConfig.Init(); }, () => { return EquipSuitAttrConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("EquipWashConfig", () => { EquipWashConfig.Init(); }, () => { return EquipWashConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("EquipWashSpecConfig", () => { EquipWashSpecConfig.Init(); }, () => { return EquipWashSpecConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("FaceConfig", () => { FaceConfig.Init(); }, () => { return FaceConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("FairyGrabBossConfig", () => { FairyGrabBossConfig.Init(); }, () => { return FairyGrabBossConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("FamilyConfig", () => { FamilyConfig.Init(); }, () => { return FamilyConfig.inited; })); |
| | |
| | | private set { s_ServerTime = value; }
|
| | | }
|
| | |
|
| | | static DateTime s_CrossServerTime = DateTime.Now;
|
| | | static float _crossCheckTime = 0;
|
| | | public static DateTime CrossServerNow
|
| | | {
|
| | | get
|
| | | {
|
| | | float tick = Time.realtimeSinceStartup - _crossCheckTime;
|
| | | DateTime real = s_CrossServerTime.AddSeconds(tick);
|
| | | return real;
|
| | | }
|
| | | private set { s_CrossServerTime = value; }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 年份
|
| | | /// </summary>
|
| | |
| | | public static event Action OnServerTimeRefresh;
|
| | | public static void OnRefreshServerTime(HA004_tagServerDateTime vNetData)
|
| | | {
|
| | | var dateTime = new DateTime(vNetData.Year, vNetData.Month, vNetData.Day, vNetData.Hour, vNetData.Minute, vNetData.Second);
|
| | | if (vNetData.socketType == ServerType.CrossSever)
|
| | | {
|
| | | return;
|
| | | s_CrossServerTime = dateTime;
|
| | | _crossCheckTime = Time.realtimeSinceStartup;
|
| | | }
|
| | |
|
| | | DateTime n = new DateTime(vNetData.Year, vNetData.Month, vNetData.Day, vNetData.Hour, vNetData.Minute, vNetData.Second);
|
| | | s_ServerTime = n;
|
| | | DebugEx.Log("OnRefreshServerTime月份:" + s_ServerTime.Month);
|
| | | _checkTime = Time.realtimeSinceStartup;
|
| | | if (OnServerTimeRefresh != null)
|
| | | else
|
| | | {
|
| | | OnServerTimeRefresh();
|
| | | s_ServerTime = dateTime;
|
| | | _checkTime = Time.realtimeSinceStartup;
|
| | | if (OnServerTimeRefresh != null)
|
| | | {
|
| | | OnServerTimeRefresh();
|
| | | }
|
| | | }
|
| | | |
| | | TimeDownMgr.Instance.Begin(TimeDownMgr.CoolTimeType.SyncServerTime, 60, (float tick) =>
|
| | | {
|
| | | SyncServerTime();
|
| | |
| | | public static event Action OnServerOpenDayRefresh;
|
| | | public static void OnRefreshServerOpenDay(HA005_tagOpenServerDay package)
|
| | | {
|
| | | if (package.socketType == ServerType.CrossSever)
|
| | | if (package.socketType != ServerType.CrossSever)
|
| | | {
|
| | | return;
|
| | | OpenDay = package.Day;
|
| | | IsMixServer = package.IsMixServer == 1;
|
| | | MixOpenDay = package.MixDay;
|
| | | openServerDayOfWeek = package.OpenWeekday == 7 ? DayOfWeek.Sunday : (DayOfWeek)package.OpenWeekday;
|
| | | }
|
| | |
|
| | | OpenDay = package.Day;
|
| | | IsMixServer = package.IsMixServer == 1;
|
| | | MixOpenDay = package.MixDay;
|
| | | openServerDayOfWeek = package.OpenWeekday == 7 ? DayOfWeek.Sunday : (DayOfWeek)package.OpenWeekday;
|
| | | OnRefreshServerTime(new HA004_tagServerDateTime()
|
| | | {
|
| | | Year = package.NowYear,
|
| | |
| | | Minute = package.NowMinute,
|
| | | Second = package.NowSecond,
|
| | | MicSecond = package.NowMicSecond,
|
| | | socketType = package.socketType,
|
| | | });
|
| | | //DateTime.TryParse(package.OpenServerTime, out openServerTime);
|
| | | if (OnServerOpenDayRefresh != null)
|
| | |
|
| | |
|
| | | if (package.socketType != ServerType.CrossSever
|
| | | && OnServerOpenDayRefresh != null)
|
| | | {
|
| | | OnServerOpenDayRefresh();
|
| | | }
|
| | |
| | |
|
| | | public static void SyncServerTime()
|
| | | {
|
| | | CA002_tagClientRequestServerTime pack = new CA002_tagClientRequestServerTime();
|
| | | GameNetSystem.Instance.SendInfo(pack);
|
| | | CA002_tagClientRequestServerTime pak = new CA002_tagClientRequestServerTime();
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | if (GameNetSystem.Instance.crossServerSocketConnected)
|
| | | {
|
| | | GameNetSystem.Instance.SendToCrossServer(pak);
|
| | | }
|
| | | }
|
| | | /// <summary>
|
| | | /// 根据服务器下发的秒数获取时间
|