Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
1个文件已删除
54个文件已修改
18 文件已复制
22个文件已添加
1 文件已重命名
| | |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public class FuncOpen |
| | | { |
| | | private static FuncOpen _inst = null; |
| | | public static FuncOpen Instance { |
| | | get { |
| | | if (_inst == null) |
| | | { |
| | | _inst = new FuncOpen(); |
| | | } |
| | | return _inst; |
| | | } |
| | | } |
| | | |
| | | protected FuncOpen() |
| | | { |
| | | if (Application.isEditor) |
| | | public class FuncOpen |
| | | { |
| | | private static FuncOpen _inst = null; |
| | | public static FuncOpen Instance { |
| | | get { |
| | | if (_inst == null) |
| | | { |
| | | if (!Application.isPlaying) return; |
| | | _inst = new FuncOpen(); |
| | | } |
| | | |
| | | var allKeys = new List<int>(FuncOpenLVConfig.dic.Keys);//GetKeys(); |
| | | funcArray = new int[allKeys.Count]; |
| | | int _index = 0; |
| | | foreach (var key in allKeys) |
| | | { |
| | | int func = key; |
| | | funcOpenState[func] = false; |
| | | funcArray[_index] = func; |
| | | _index++; |
| | | } |
| | | |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent; |
| | | DTC0102_tagCDBPlayer.switchAccountEvent += SwitchAccountEvent; |
| | | |
| | | funcClientLVLimitDict.Clear(); |
| | | var jsonConfig = JsonMapper.ToObject(FuncConfigConfig.Get("FuncLevelLimitClient").Numerical1); |
| | | foreach (var key in jsonConfig.Keys) |
| | | { |
| | | funcClientLVLimitDict[int.Parse(key)] = int.Parse(jsonConfig[key].ToString()); |
| | | } |
| | | } |
| | | |
| | | private void BeforePlayerDataInitializeEvent() |
| | | { |
| | | for (int i = 0; i < funcArray.Length; i++) |
| | | { |
| | | funcOpenState[funcArray[i]] = false; |
| | | } |
| | | } |
| | | |
| | | private void SwitchAccountEvent() |
| | | { |
| | | for (int i = 0; i < funcArray.Length; i++) |
| | | { |
| | | funcOpenState[funcArray[i]] = false; |
| | | if (OnFuncStateChangeEvent != null) |
| | | { |
| | | OnFuncStateChangeEvent(funcArray[i]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // TaskModel m_TaskModel; |
| | | // TaskModel taskmodel { get { return m_TaskModel ?? (m_TaskModel = ModelCenter.Instance.GetModel<TaskModel>()); } } |
| | | private static Dictionary<int, bool> funcOpenState = new Dictionary<int, bool>(); |
| | | private int[] funcArray; |
| | | |
| | | public event Action<int> OnFuncStateChangeEvent; |
| | | |
| | | //纯客户端的功能等级限制, key 以功能配置表的FuncLevelLimitClient为准 |
| | | //1. 精彩活动-全服红包显示等级 |
| | | public Dictionary<int, int> funcClientLVLimitDict = new Dictionary<int, int>(); |
| | | public bool IsClientLVLimit(int key) |
| | | { |
| | | if (!funcClientLVLimitDict.ContainsKey(key)) |
| | | return true; |
| | | |
| | | if (PlayerDatas.Instance.baseData.LV >= funcClientLVLimitDict[key]) |
| | | return true; |
| | | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | public void UpdateFuncState(HA302_tagMCFuncOpenStateList vNetData) |
| | | { |
| | | for (int i = 0; i < vNetData.FuncCount; i++) |
| | | { |
| | | |
| | | var funcState = vNetData.FuncStateList[i]; |
| | | |
| | | bool bPerFuncIsOpen = false; |
| | | bool bAfterFuncIsOpen = false; |
| | | |
| | | if (!funcOpenState.ContainsKey(funcState.FuncID)) |
| | | { |
| | | funcOpenState.Add(funcState.FuncID, funcState.State == 1); |
| | | bAfterFuncIsOpen = true; |
| | | } |
| | | else |
| | | { |
| | | bPerFuncIsOpen = funcOpenState[funcState.FuncID]; |
| | | funcOpenState[funcState.FuncID] = funcState.State == 1; |
| | | bAfterFuncIsOpen = funcOpenState[funcState.FuncID]; |
| | | } |
| | | if (OnFuncStateChangeEvent != null) |
| | | { |
| | | OnFuncStateChangeEvent(funcState.FuncID); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private bool IsFuncOpen(int key, out int errorCode) |
| | | { |
| | | |
| | | errorCode = 0; |
| | | var config = FuncOpenLVConfig.Get(key); |
| | | if (config == null) |
| | | { |
| | | return false; |
| | | } |
| | | // if (config.LimitMagicWeapon > 0) |
| | | // { |
| | | // Treasure treasure = null; |
| | | // var _stage = config.LimitMagicWeapon % 100; |
| | | // ModelCenter.Instance.GetModel<TreasureModel>().TryGetTreasure(config.LimitMagicWeapon / 100, out treasure); |
| | | // if (treasure == null || treasure.state != TreasureState.Collected || treasure.level < _stage) |
| | | // { |
| | | // errorCode = 2; |
| | | // return false; |
| | | // } |
| | | // } |
| | | // if (config.LimitMissionID > 0) |
| | | // { |
| | | // MissionDetailDates missionDetailDates = null; |
| | | // taskmodel.allMissionDict.TryGetValue(config.LimitMissionID, out missionDetailDates); |
| | | // if (missionDetailDates == null || missionDetailDates.MissionState != 3) |
| | | // { |
| | | // errorCode = 4; |
| | | // return false; |
| | | // } |
| | | // } |
| | | // if (config.LimiRealmLV > 0 && PlayerDatas.Instance.baseData.realmLevel < config.LimiRealmLV) |
| | | // { |
| | | // errorCode = 3; |
| | | // return false; |
| | | // } |
| | | if (config.LimitLV > 0 && PlayerDatas.Instance.baseData.LV < config.LimitLV) |
| | | { |
| | | errorCode = 1; |
| | | return false; |
| | | } |
| | | return true; |
| | | // return false; |
| | | } |
| | | |
| | | public bool IsFuncOpen(int key, bool tip = false) |
| | | { |
| | | bool isOpen = false; |
| | | if (funcOpenState.ContainsKey(key)) |
| | | isOpen = funcOpenState[key]; |
| | | if (!isOpen && tip) |
| | | ProcessorFuncErrorTip(key); |
| | | return isOpen; |
| | | } |
| | | |
| | | public void ProcessorFuncErrorTip(int key) |
| | | { |
| | | var config = FuncOpenLVConfig.Get(key); |
| | | if (config != null) |
| | | { |
| | | SoundPlayer.Instance.PlayUIAudio(SoundPlayer.defaultClickNegativeAudio); |
| | | if (config.Tip.Equals("FuncLimit_Level")) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip(config.Tip); |
| | | return; |
| | | } |
| | | var errorCode = 0; |
| | | if (!IsFuncOpen(key, out errorCode)) |
| | | { |
| | | switch (errorCode) |
| | | { |
| | | case 1: |
| | | SysNotifyMgr.Instance.ShowTip(config.Tip, Language.Get("OpenFunc4", config.LimitLV)); |
| | | break; |
| | | // TODO YYL |
| | | // case 2: |
| | | // var treasureConfig = TreasureConfig.Get(config.LimitMagicWeapon / 100); |
| | | // SysNotifyMgr.Instance.ShowTip(config.Tip, Language.Get("OpenFunc1", treasureConfig != null ? treasureConfig.Name : string.Empty)); |
| | | // break; |
| | | // case 3: |
| | | // SysNotifyMgr.Instance.ShowTip(config.Tip, UIHelper.GetRealmName(config.LimiRealmLV, true)); |
| | | // break; |
| | | case 4: |
| | | if (config.LimitLV > 0) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip(config.Tip, Language.Get("OpenFunc2", config.LimitLV)); |
| | | } |
| | | else |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip(config.Tip, Language.Get("OpenFunc3")); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public int GetLimitLv(int key) |
| | | { |
| | | // FuncOpenLVConfig tagFuncOpenLVModel = FuncOpenLVConfig.Get(key); |
| | | // if (tagFuncOpenLVModel.LimitLV != 0) |
| | | // { |
| | | // return tagFuncOpenLVModel.LimitLV; |
| | | // } |
| | | // if (tagFuncOpenLVModel.LimitMissionID != 0) |
| | | // { |
| | | // var TaskConfig = PyTaskConfig.Get(tagFuncOpenLVModel.LimitMissionID); |
| | | // return TaskConfig.lv; |
| | | // } |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | Dictionary<int, ICheckFuncOpen> m_CheckFuncDict = new Dictionary<int, ICheckFuncOpen>(); |
| | | public void Register(int _key, ICheckFuncOpen _check) |
| | | { |
| | | if (!m_CheckFuncDict.ContainsKey(_key)) |
| | | { |
| | | m_CheckFuncDict.Add(_key, _check); |
| | | } |
| | | } |
| | | |
| | | public bool CheckFuncOpen(int _key) |
| | | { |
| | | if (m_CheckFuncDict.ContainsKey(_key)) |
| | | { |
| | | return m_CheckFuncDict[_key].CheckFunc(); |
| | | } |
| | | return true; |
| | | return _inst; |
| | | } |
| | | } |
| | | |
| | | public interface ICheckFuncOpen |
| | | protected FuncOpen() |
| | | { |
| | | bool CheckFunc(); |
| | | } |
| | | if (Application.isEditor) |
| | | { |
| | | if (!Application.isPlaying) return; |
| | | } |
| | | |
| | | var allKeys = new List<int>(FuncOpenLVConfig.dic.Keys);//GetKeys(); |
| | | funcArray = new int[allKeys.Count]; |
| | | int _index = 0; |
| | | foreach (var key in allKeys) |
| | | { |
| | | int func = key; |
| | | funcOpenState[func] = false; |
| | | funcArray[_index] = func; |
| | | _index++; |
| | | } |
| | | |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent; |
| | | DTC0102_tagCDBPlayer.switchAccountEvent += SwitchAccountEvent; |
| | | |
| | | funcClientLVLimitDict.Clear(); |
| | | var jsonConfig = JsonMapper.ToObject(FuncConfigConfig.Get("FuncLevelLimitClient").Numerical1); |
| | | foreach (var key in jsonConfig.Keys) |
| | | { |
| | | funcClientLVLimitDict[int.Parse(key)] = int.Parse(jsonConfig[key].ToString()); |
| | | } |
| | | } |
| | | |
| | | private void BeforePlayerDataInitializeEvent() |
| | | { |
| | | for (int i = 0; i < funcArray.Length; i++) |
| | | { |
| | | funcOpenState[funcArray[i]] = false; |
| | | } |
| | | } |
| | | |
| | | private void SwitchAccountEvent() |
| | | { |
| | | for (int i = 0; i < funcArray.Length; i++) |
| | | { |
| | | funcOpenState[funcArray[i]] = false; |
| | | if (OnFuncStateChangeEvent != null) |
| | | { |
| | | OnFuncStateChangeEvent(funcArray[i]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // TaskModel m_TaskModel; |
| | | // TaskModel taskmodel { get { return m_TaskModel ?? (m_TaskModel = ModelCenter.Instance.GetModel<TaskModel>()); } } |
| | | private static Dictionary<int, bool> funcOpenState = new Dictionary<int, bool>(); |
| | | private int[] funcArray; |
| | | |
| | | public event Action<int> OnFuncStateChangeEvent; |
| | | |
| | | //纯客户端的功能等级限制, key 以功能配置表的FuncLevelLimitClient为准 |
| | | //1. 精彩活动-全服红包显示等级 |
| | | public Dictionary<int, int> funcClientLVLimitDict = new Dictionary<int, int>(); |
| | | public bool IsClientLVLimit(int key) |
| | | { |
| | | if (!funcClientLVLimitDict.ContainsKey(key)) |
| | | return true; |
| | | |
| | | if (PlayerDatas.Instance.baseData.LV >= funcClientLVLimitDict[key]) |
| | | return true; |
| | | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | public void UpdateFuncState(HA302_tagMCFuncOpenStateList vNetData) |
| | | { |
| | | for (int i = 0; i < vNetData.FuncCount; i++) |
| | | { |
| | | |
| | | var funcState = vNetData.FuncStateList[i]; |
| | | |
| | | bool bPerFuncIsOpen = false; |
| | | bool bAfterFuncIsOpen = false; |
| | | |
| | | if (!funcOpenState.ContainsKey(funcState.FuncID)) |
| | | { |
| | | funcOpenState.Add(funcState.FuncID, funcState.State == 1); |
| | | bAfterFuncIsOpen = true; |
| | | } |
| | | else |
| | | { |
| | | bPerFuncIsOpen = funcOpenState[funcState.FuncID]; |
| | | funcOpenState[funcState.FuncID] = funcState.State == 1; |
| | | bAfterFuncIsOpen = funcOpenState[funcState.FuncID]; |
| | | } |
| | | if (OnFuncStateChangeEvent != null) |
| | | { |
| | | OnFuncStateChangeEvent(funcState.FuncID); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private bool IsFuncOpen(int key, out int errorCode) |
| | | { |
| | | |
| | | errorCode = 0; |
| | | var config = FuncOpenLVConfig.Get(key); |
| | | if (config == null) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if (config.OpenDay > 0) |
| | | { |
| | | if (config.OpenDay > TimeUtility.OpenDay + 1) |
| | | { |
| | | errorCode = 2; |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | if (config.LimitMissionID > 0) |
| | | { |
| | | |
| | | if (TaskManager.Instance.GetNeedFinishTaskCount(config.LimitMissionID) > 0) |
| | | { |
| | | errorCode = 4; |
| | | return false; |
| | | } |
| | | } |
| | | if (config.LimiRealmLV > 0 && PlayerDatas.Instance.baseData.realmLevel < config.LimiRealmLV) |
| | | { |
| | | errorCode = 3; |
| | | return false; |
| | | } |
| | | if (config.LimitLV > 0 && PlayerDatas.Instance.baseData.LV < config.LimitLV) |
| | | { |
| | | errorCode = 1; |
| | | return false; |
| | | } |
| | | return true; |
| | | // return false; |
| | | } |
| | | |
| | | public bool IsFuncOpen(int key, bool tip = false) |
| | | { |
| | | bool isOpen = false; |
| | | if (funcOpenState.ContainsKey(key)) |
| | | isOpen = funcOpenState[key]; |
| | | if (!isOpen && tip) |
| | | ProcessorFuncErrorTip(key); |
| | | return isOpen; |
| | | } |
| | | |
| | | public void ProcessorFuncErrorTip(int key) |
| | | { |
| | | var config = FuncOpenLVConfig.Get(key); |
| | | if (config != null) |
| | | { |
| | | SoundPlayer.Instance.PlayUIAudio(SoundPlayer.defaultClickNegativeAudio); |
| | | |
| | | var errorCode = 0; |
| | | if (!IsFuncOpen(key, out errorCode)) |
| | | { |
| | | switch (errorCode) |
| | | { |
| | | case 1: |
| | | SysNotifyMgr.Instance.ShowStringTip(Language.Get("FuncLimit_Level", config.LimitLV) |
| | | + Language.Get("FuncLimitOpen1")); |
| | | break; |
| | | case 2: |
| | | //开服多少天 一般是组合 |
| | | if (config.LimitLV != 0) |
| | | { |
| | | SysNotifyMgr.Instance.ShowStringTip(Language.Get("FuncLimit_OpenDay", config.OpenDay) |
| | | + Language.Get("FuncLimitOpen2") |
| | | + Language.Get("FuncLimit_Level", config.LimitLV) |
| | | + Language.Get("FuncLimitOpen1")); |
| | | |
| | | } |
| | | else if (config.LimitMissionID != 0) |
| | | { |
| | | SysNotifyMgr.Instance.ShowStringTip(Language.Get("FuncLimit_OpenDay", config.OpenDay) |
| | | + Language.Get("FuncLimitOpen2") |
| | | + Language.Get("FuncLimit_Mission", TaskManager.Instance.GetNeedFinishTaskCount(config.LimitMissionID)) |
| | | + Language.Get("FuncLimitOpen1")); |
| | | } |
| | | else |
| | | { |
| | | SysNotifyMgr.Instance.ShowStringTip(Language.Get("FuncLimit_OpenDay", config.OpenDay) |
| | | + Language.Get("FuncLimitOpen1")); |
| | | } |
| | | break; |
| | | case 3: |
| | | SysNotifyMgr.Instance.ShowStringTip(Language.Get("FuncLimit_Realm", RealmConfig.Get(config.LimiRealmLV).Name) |
| | | + Language.Get("FuncLimitOpen1")); |
| | | break; |
| | | case 4: |
| | | SysNotifyMgr.Instance.ShowStringTip(Language.Get("FuncLimit_Mission", TaskManager.Instance.GetNeedFinishTaskCount(config.LimitMissionID)) |
| | | + Language.Get("FuncLimitOpen1")); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public int GetLimitLv(int key) |
| | | { |
| | | // FuncOpenLVConfig tagFuncOpenLVModel = FuncOpenLVConfig.Get(key); |
| | | // if (tagFuncOpenLVModel.LimitLV != 0) |
| | | // { |
| | | // return tagFuncOpenLVModel.LimitLV; |
| | | // } |
| | | // if (tagFuncOpenLVModel.LimitMissionID != 0) |
| | | // { |
| | | // var TaskConfig = PyTaskConfig.Get(tagFuncOpenLVModel.LimitMissionID); |
| | | // return TaskConfig.lv; |
| | | // } |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | Dictionary<int, ICheckFuncOpen> m_CheckFuncDict = new Dictionary<int, ICheckFuncOpen>(); |
| | | public void Register(int _key, ICheckFuncOpen _check) |
| | | { |
| | | if (!m_CheckFuncDict.ContainsKey(_key)) |
| | | { |
| | | m_CheckFuncDict.Add(_key, _check); |
| | | } |
| | | } |
| | | |
| | | public bool CheckFuncOpen(int _key) |
| | | { |
| | | if (m_CheckFuncDict.ContainsKey(_key)) |
| | | { |
| | | return m_CheckFuncDict[_key].CheckFunc(); |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | public interface ICheckFuncOpen |
| | | { |
| | | bool CheckFunc(); |
| | | } |
| | |
| | | using System; |
| | | using UnityEngine.EventSystems; |
| | | |
| | | public class UIFuncOpen : MonoBehaviour, IPointerClickHandler |
| | | public class UIFuncOpen : MonoBehaviour, IPointerClickHandler |
| | | { |
| | | [SerializeField] int funcOpenKey; |
| | | [SerializeField] GameObject LockImg; |
| | | [SerializeField] bool active = true; |
| | | public int id { get { return funcOpenKey; } } |
| | | |
| | | private Button funcBtn; |
| | | |
| | | private void Awake() |
| | | { |
| | | [SerializeField] int funcOpenKey; |
| | | [SerializeField] GameObject LockImg; |
| | | [SerializeField] bool active = true; |
| | | public int id { get { return funcOpenKey; } } |
| | | funcBtn = GetComponent<Button>(); |
| | | |
| | | private Button funcBtn; |
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent; |
| | | } |
| | | |
| | | private void Awake() |
| | | public void OnPointerClick(PointerEventData eventData) |
| | | { |
| | | if (!FuncOpen.Instance.IsFuncOpen(funcOpenKey)) |
| | | { |
| | | funcBtn = GetComponent<Button>(); |
| | | |
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent; |
| | | FuncOpen.Instance.ProcessorFuncErrorTip(funcOpenKey); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | public void OnPointerClick(PointerEventData eventData) |
| | | { |
| | | if (!FuncOpen.Instance.IsFuncOpen(funcOpenKey)) |
| | | { |
| | | FuncOpen.Instance.ProcessorFuncErrorTip(funcOpenKey); |
| | | return; |
| | | } |
| | | } |
| | | private void OnEnable() |
| | | { |
| | | SetState(); |
| | | } |
| | | |
| | | private void OnEnable() |
| | | private void OnFuncStateChangeEvent(int func) |
| | | { |
| | | if (funcOpenKey == func) |
| | | { |
| | | SetState(); |
| | | } |
| | | } |
| | | |
| | | private void OnFuncStateChangeEvent(int func) |
| | | private void OnDestroy() |
| | | { |
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent; |
| | | } |
| | | private void SetState() |
| | | { |
| | | var IsOpen = FuncOpen.Instance.IsFuncOpen(funcOpenKey); |
| | | var _funcOpenCfg = FuncOpenLVConfig.Get(funcOpenKey); |
| | | |
| | | if (_funcOpenCfg == null) |
| | | { |
| | | if (funcOpenKey == func) |
| | | { |
| | | SetState(); |
| | | } |
| | | IsOpen = true; |
| | | active = true; |
| | | } |
| | | |
| | | private void OnDestroy() |
| | | if (funcBtn != null) |
| | | { |
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent; |
| | | funcBtn.interactable = IsOpen; |
| | | } |
| | | private void SetState() |
| | | |
| | | |
| | | if (LockImg != null) |
| | | { |
| | | var IsOpen = FuncOpen.Instance.IsFuncOpen(funcOpenKey); |
| | | var _funcOpenCfg = FuncOpenLVConfig.Get(funcOpenKey); |
| | | LockImg.SetActive(!IsOpen); |
| | | } |
| | | |
| | | if (_funcOpenCfg == null) |
| | | { |
| | | IsOpen = true; |
| | | active = true; |
| | | } |
| | | // 未开启是否显示的配置 |
| | | // if (_funcOpenCfg != null && _funcOpenCfg.open == 0) |
| | | // { |
| | | // gameObject.SetActive(false); |
| | | // return; |
| | | // } |
| | | |
| | | if (funcBtn != null) |
| | | if (!active) |
| | | { |
| | | gameObject.SetActive(IsOpen); |
| | | } |
| | | else |
| | | { |
| | | if (!gameObject.activeSelf) |
| | | { |
| | | funcBtn.interactable = IsOpen; |
| | | } |
| | | |
| | | |
| | | if (LockImg != null) |
| | | { |
| | | LockImg.SetActive(!IsOpen); |
| | | } |
| | | |
| | | if (_funcOpenCfg != null && _funcOpenCfg.open == 0) |
| | | { |
| | | gameObject.SetActive(false); |
| | | return; |
| | | } |
| | | |
| | | if (!active) |
| | | { |
| | | gameObject.SetActive(IsOpen); |
| | | } |
| | | else |
| | | { |
| | | if (!gameObject.activeSelf) |
| | | { |
| | | gameObject.SetActive(true); |
| | | } |
| | | gameObject.SetActive(true); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | private Dictionary<Component, TimeItem> timeItems = new Dictionary<Component, TimeItem>(); |
| | | private List<TimeItem> timeItemList = new List<TimeItem>(); |
| | | private int hourBuff = -1; |
| | | private int minuteBuff = -1; |
| | | public int dayBuff = -1; |
| | | public int monthBuff { get { return LocalSave.GetInt("month"); } private set { LocalSave.SetInt("month", value); } } |
| | | public int weekBuff { get { return LocalSave.GetInt("week"); } private set { LocalSave.SetInt("week", value); } } |
| | | public event Action OnDayEvent; |
| | | public event Action OnHourEvent; |
| | | public event Action OnMinuteEvent; |
| | | public event Action OnMonthAfterPlayerDataInitializeEvent; |
| | | public event Action OnWeekAfterPlayerDataInitializeEvent; |
| | | |
| | |
| | | OnHourEvent(); |
| | | } |
| | | hourBuff = TimeUtility.ServerNow.Hour; |
| | | } |
| | | if (minuteBuff != TimeUtility.ServerNow.Minute) |
| | | { |
| | | if (OnMinuteEvent != null) |
| | | { |
| | | OnMinuteEvent(); |
| | | } |
| | | minuteBuff = TimeUtility.ServerNow.Minute; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年8月20日
|
| | | // [ Date ]: 2025年8月28日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | public int LimitLV;
|
| | | public int LimiRealmLV;
|
| | | public int LimitMissionID;
|
| | | public int OpenDay;
|
| | | public string Name;
|
| | | public string Desc;
|
| | | public string Tip;
|
| | | public string Icon;
|
| | | public int open;
|
| | | public Dictionary<int, int[][]> Award;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | |
| | |
|
| | | int.TryParse(tables[3],out LimitMissionID);
|
| | |
|
| | | Name = tables[4];
|
| | | int.TryParse(tables[4],out OpenDay); |
| | |
|
| | | Desc = tables[5];
|
| | | Name = tables[5];
|
| | |
|
| | | Tip = tables[6];
|
| | | Desc = tables[6];
|
| | |
|
| | | Icon = tables[7];
|
| | |
|
| | | int.TryParse(tables[8],out open); |
| | | Award = ConfigParse.ParseIntArray2Dict(tables[8]); |
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年8月7日
|
| | | // [ Date ]: Thursday, August 28, 2025
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | }
|
| | |
|
| | | public int Quality;
|
| | | public int[] UPCostItem;
|
| | | public int InitStarUpper;
|
| | | public int InitAddPer;
|
| | | public int LVAddPer;
|
| | |
| | | string[] tables = input.Split('\t');
|
| | | int.TryParse(tables[0],out Quality);
|
| | |
|
| | | if (tables[1].Contains("[")) |
| | | int.TryParse(tables[1],out InitStarUpper); |
| | |
|
| | | int.TryParse(tables[2],out InitAddPer); |
| | |
|
| | | int.TryParse(tables[3],out LVAddPer); |
| | |
|
| | | int.TryParse(tables[4],out BreakLVAddPer); |
| | |
|
| | | int.TryParse(tables[5],out StarAddPer); |
| | |
|
| | | if (tables[6].Contains("[")) |
| | | { |
| | | UPCostItem = JsonMapper.ToObject<int[]>(tables[1]); |
| | | BookActAwardMoney = JsonMapper.ToObject<int[]>(tables[6]); |
| | | } |
| | | else |
| | | { |
| | | string[] UPCostItemStringArray = tables[1].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | UPCostItem = new int[UPCostItemStringArray.Length]; |
| | | for (int i=0;i<UPCostItemStringArray.Length;i++) |
| | | { |
| | | int.TryParse(UPCostItemStringArray[i],out UPCostItem[i]); |
| | | } |
| | | }
|
| | |
|
| | | int.TryParse(tables[2],out InitStarUpper); |
| | |
|
| | | int.TryParse(tables[3],out InitAddPer); |
| | |
|
| | | int.TryParse(tables[4],out LVAddPer); |
| | |
|
| | | int.TryParse(tables[5],out BreakLVAddPer); |
| | |
|
| | | int.TryParse(tables[6],out StarAddPer); |
| | |
|
| | | if (tables[7].Contains("[")) |
| | | { |
| | | BookActAwardMoney = JsonMapper.ToObject<int[]>(tables[7]); |
| | | } |
| | | else |
| | | { |
| | | string[] BookActAwardMoneyStringArray = tables[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | string[] BookActAwardMoneyStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | BookActAwardMoney = new int[BookActAwardMoneyStringArray.Length]; |
| | | for (int i=0;i<BookActAwardMoneyStringArray.Length;i++) |
| | | { |
| | |
| | | } |
| | | }
|
| | |
|
| | | int.TryParse(tables[8],out BookInitAddPer); |
| | | int.TryParse(tables[7],out BookInitAddPer); |
| | |
|
| | | int.TryParse(tables[9],out BookStarAddPer); |
| | | int.TryParse(tables[8],out BookStarAddPer); |
| | |
|
| | | int.TryParse(tables[10],out BookBreakLVAddPer); |
| | | int.TryParse(tables[9],out BookBreakLVAddPer); |
| | |
|
| | | DismissReturnItems = JsonMapper.ToObject<int[][]>(tables[11].Replace("(", "[").Replace(")", "]")); |
| | | DismissReturnItems = JsonMapper.ToObject<int[][]>(tables[10].Replace("(", "[").Replace(")", "]")); |
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年8月5日
|
| | | // [ Date ]: 2025年8月27日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年8月5日
|
| | | // [ Date ]: 2025年8月27日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Sunday, February 04, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | public partial class ChestsAwardConfig : ConfigBase<int, ChestsAwardConfig>
|
| | | {
|
| | |
| | | public partial class RealmLVUPTaskConfig : ConfigBase<int, RealmLVUPTaskConfig> |
| | | { |
| | | //官职:任务ID:索引id |
| | | private static Dictionary<int, Dictionary<int, int>> missionDict = new Dictionary<int, Dictionary<int, int>>(); |
| | | private static Dictionary<int, Dictionary<int, RealmLVUPTaskConfig>> missionDict = new Dictionary<int, Dictionary<int, RealmLVUPTaskConfig>>(); |
| | | |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | if (!missionDict.ContainsKey(Lv)) |
| | | { |
| | | missionDict.Add(Lv, new Dictionary<int, int>()); |
| | | missionDict.Add(Lv, new Dictionary<int, RealmLVUPTaskConfig>()); |
| | | } |
| | | missionDict[Lv][TaskID] = ID; |
| | | missionDict[Lv][TaskID] = this; |
| | | } |
| | | |
| | | public static int GetID(int realmLV, int taskID) |
| | | public static RealmLVUPTaskConfig GetID(int realmLV, int taskID) |
| | | { |
| | | if (missionDict.ContainsKey(realmLV) && missionDict[realmLV].ContainsKey(taskID)) |
| | | { |
| | | return missionDict[realmLV][taskID]; |
| | | } |
| | | return -1; |
| | | return null; |
| | | } |
| | | |
| | | public static List<int> GetMissionIDs(int lv) |
| | |
| | | public uint bindDiamond; //灵石 |
| | | public uint copper; //铜钱 |
| | | public long allCopper { get { return copper + copperExtend * Constants.ExpPointValue; } } |
| | | public long FightPoint; //战斗值 |
| | | public long UseHarmerCount; //消耗锤子个数(倍数) |
| | | public ushort MapID; //角色所在地图 地图规则:C/S一一对应的常规地图,C假地图(ExAttr14),多C一个S地图(ExAttr3) |
| | | public ushort PosX; //角色坐标 |
| | | public ushort PosY; |
| | |
| | | public byte FBID; //fb id |
| | | public byte realmLevel; //官职 |
| | | public byte VIPLv; //VIP等级 |
| | | public uint ExAttr1; // 协助目标玩家ID,非0变0退出协助 |
| | | public uint ExAttr1; // 策划配置关卡ID为201,即 过关2-1(0/1) ,使用 ExAttr1 值判断,如ExAttr1值为20103代表当前已经过了第2章第1关第3波,包含了波,需要击败该关卡boss后才算该关过关 |
| | | public uint teamAutoOperateFlag; //扩展属性2,各项目专用 |
| | | public int dungeonLineId; // 副本线路id |
| | | public int dungeonMapId; // 副本用作 DataMapId,单人副本存在1.假副本 2.服务端1对客户端多地图同分线 3.服务端1对客户端多地图不同分线 |
| | |
| | | uint m_coinPointTotal; |
| | | public int face;//头像 |
| | | public int facePic;//头像外框 |
| | | public long FightPower; //战斗力 |
| | | |
| | | public uint coinPointTotal { |
| | | public uint coinPointTotal |
| | | { |
| | | private get { return m_coinPointTotal; } |
| | | set { |
| | | set |
| | | { |
| | | CoinChangeEvent?.Invoke((int)m_coinPointTotal, (int)value); |
| | | m_coinPointTotal = value; |
| | | } |
| | |
| | | CON = _serverInfo.CON; |
| | | Setting = _serverInfo.Setting; |
| | | FBID = _serverInfo.FBID; |
| | | ExAttr1 = _serverInfo.ExAttr1; |
| | | ExAttr1 = _serverInfo.ExAttr1; //策划配置关卡ID为201,即 过关2-1(0/1) ,使用 ExAttr1 值判断,如ExAttr1值为20103代表当前已经过了第2章第1关第3波,包含了波,需要击败该关卡boss后才算该关过关 |
| | | teamAutoOperateFlag = _serverInfo.ExAttr2; |
| | | dungeonLineId = (int)_serverInfo.ExAttr3 % 1000; |
| | | dungeonMapId = (int)_serverInfo.ExAttr3 / 1000; |
| | |
| | | |
| | | HP = _serverInfo.HP + _serverInfo.HPEx * Constants.ExpPointValue; |
| | | AttackMode = _serverInfo.AttackMode; |
| | | UseHarmerCount = (int)_serverInfo.FightPoint; //锤子倍数,非战斗力 |
| | | |
| | | } |
| | | |
| | |
| | | break; |
| | | case PlayerDataType.TeamLV: |
| | | break; |
| | | case PlayerDataType.UseHarmerCount: |
| | | baseData.UseHarmerCount = value; |
| | | break; |
| | | case PlayerDataType.FightPower: |
| | | baseData.FightPoint = value + valueEx * Constants.ExpPointValue; |
| | | PlayerMainDate.Instance.PowerAdd(baseData.FightPoint); |
| | | baseData.FightPower = value + valueEx * Constants.ExpPointValue; |
| | | PlayerMainDate.Instance.PowerAdd(baseData.FightPower); |
| | | break; |
| | | case PlayerDataType.Tick: |
| | | #if UNITY_EDITOR |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //03 03 设置快捷栏保存#tagCSetShutCutData
|
| | |
|
| | | public class C0303_tagCSetShutCutData : GameNetPackBasic {
|
| | | public string Setting;
|
| | |
|
| | | public C0303_tagCSetShutCutData () {
|
| | | _cmd = (ushort)0x0303;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (Setting, NetDataType.Chars, 100);
|
| | | }
|
| | |
|
| | | }
|
copy from Main/Component/UI/Common/FuncEnable.cs.meta
copy to Main/Core/NetworkPackage/ClientPack/C03_MainCharacter/C0303_tagCSetShutCutData.cs.meta
File was copied from Main/Component/UI/Common/FuncEnable.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e034d1a3f772bb44bbbcd4273f5084e1 |
| | | timeCreated: 1516430103 |
| | | licenseType: Free |
| | | guid: 35992e06ad8ed6049bbfca868849f3d1 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A5 23 提升境界等级 # tagCMRealmLVUp
|
| | |
|
| | | public class CA523_tagCMRealmLVUp : GameNetPackBasic {
|
| | |
|
| | | public CA523_tagCMRealmLVUp () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xA523;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | }
|
| | |
|
| | | }
|
copy from Main/Component/UI/Common/FuncEnable.cs.meta
copy to Main/Core/NetworkPackage/ClientPack/CA5_Function/CA523_tagCMRealmLVUp.cs.meta
File was copied from Main/Component/UI/Common/FuncEnable.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e034d1a3f772bb44bbbcd4273f5084e1 |
| | | timeCreated: 1516430103 |
| | | licenseType: Free |
| | | guid: 3a06990786c9e0942bdb91bbcb19914c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B2 23 仙树升级 #tagCMTreeLVUP
|
| | |
|
| | | public class CB223_tagCMTreeLVUP : GameNetPackBasic {
|
| | | public byte Type; // 0-开始升级(请求扣除消耗,开始升级倒计时);1-执行升级(前端自行倒计时,时间到后发送该类型)
|
| | |
|
| | | public CB223_tagCMTreeLVUP () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xB223;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (Type, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
copy from Main/Component/UI/Common/FuncEnable.cs.meta
copy to Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB223_tagCMTreeLVUP.cs.meta
File was copied from Main/Component/UI/Common/FuncEnable.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e034d1a3f772bb44bbbcd4273f5084e1 |
| | | timeCreated: 1516430103 |
| | | licenseType: Free |
| | | guid: 647b6a53269ebc54ba1cdbbd2d5d3c79 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B2 24 使用仙树升级减时物品 #tagCMUseTreeLVUPTimeItem
|
| | |
|
| | | public class CB224_tagCMUseTreeLVUPTimeItem : GameNetPackBasic {
|
| | | public uint UseCount; // 使用个数
|
| | | public byte IsAutoBuy; // 不足个数是否自动购买
|
| | |
|
| | | public CB224_tagCMUseTreeLVUPTimeItem () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xB224;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (UseCount, NetDataType.DWORD);
|
| | | WriteBytes (IsAutoBuy, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
File was renamed from Main/Component/UI/Common/FuncEnable.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e034d1a3f772bb44bbbcd4273f5084e1 |
| | | timeCreated: 1516430103 |
| | | licenseType: Free |
| | | guid: 7fc725d02eee6f745bb03e23287408a0 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | |
| | |
|
| | | PlayerDatas.Instance.InitPlayerData(package);
|
| | | PlayerDatas.Instance.RequestWorldTick();
|
| | |
|
| | | QuickSetting.Instance.SetQuickSetting(package.Setting);
|
| | | if (playerIdBuf != 0 && playerIdBuf != PlayerDatas.Instance.baseData.PlayerID)
|
| | | {
|
| | | if (switchAccountEvent != null)
|
| | |
| | | playerLoginOkEvent?.Invoke();
|
| | | }
|
| | | finishedLogin = true;
|
| | | if (PlayerDatas.Instance.baseData.FightPoint == 0)
|
| | | { |
| | | if (PlayerDatas.Instance.baseData.UseHarmerCount == 0)
|
| | | {
|
| | | //防范请求
|
| | | BattleManager.Instance.MainFightRequest(1, 1);
|
| | | }
|
| | | //if (mapInitOkEvent != null)
|
| | |
| | | // mapInitOkEvent();
|
| | | //}
|
| | |
|
| | | GetCreateRoleAward();
|
| | | }
|
| | |
|
| | | void GetCreateRoleAward()
|
| | | {
|
| | | if (DTCA720_tagMCCreateRoleAwardState.m_GetState == 0)
|
| | | {
|
| | | var pack = new CA504_tagCMPlayerGetReward();
|
| | | pack.RewardType = 32;
|
| | | GameNetSystem.Instance.SendInfo(pack);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A7 20 创角奖励领奖状态 #tagMCCreateRoleAwardState
|
| | |
|
| | | public class DTCA720_tagMCCreateRoleAwardState : DtcBasic {
|
| | | public static int m_GetState;
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | HA720_tagMCCreateRoleAwardState vNetData = vNetPack as HA720_tagMCCreateRoleAwardState;
|
| | | m_GetState = vNetData.GetState;
|
| | | }
|
| | | }
|
copy from Main/Component/UI/Common/FuncEnable.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HA7_Interaction/DTCA720_tagMCCreateRoleAwardState.cs.meta
File was copied from Main/Component/UI/Common/FuncEnable.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e034d1a3f772bb44bbbcd4273f5084e1 |
| | | timeCreated: 1516430103 |
| | | licenseType: Free |
| | | guid: 6303ee5b4a861ac419e36a73a138bf03 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // B1 21 仙树信息 #tagMCTreeInfo
|
| | |
|
| | | public class DTCB121_tagMCTreeInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | HB121_tagMCTreeInfo vNetData = vNetPack as HB121_tagMCTreeInfo;
|
| | | BlessLVManager.Instance.UpdateBlessLVInfo(vNetData);
|
| | | }
|
| | | }
|
copy from Main/Component/UI/Common/FuncEnable.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB121_tagMCTreeInfo.cs.meta
File was copied from Main/Component/UI/Common/FuncEnable.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e034d1a3f772bb44bbbcd4273f5084e1 |
| | | timeCreated: 1516430103 |
| | | licenseType: Free |
| | | guid: b2ffbbf1287918e4f964b34b469a7fec |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | |
| | | Register(typeof(HA814_tagMCMakeItemAnswer), typeof(DTCA814_tagMCMakeItemAnswer)); |
| | | Register(typeof(HB122_tagSCHeroInfo), typeof(DTCB122_tagSCHeroInfo)); |
| | | Register(typeof(HA338_tagMCInvestInfo), typeof(DTCA338_tagMCInvestInfo)); |
| | | Register(typeof(HB121_tagMCTreeInfo), typeof(DTCB121_tagMCTreeInfo)); |
| | | Register(typeof(HA720_tagMCCreateRoleAwardState), typeof(DTCA720_tagMCCreateRoleAwardState)); |
| | | } |
| | | |
| | | //主工程注册封包 |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | //01 02 玩家初始化#tagCDBPlayer
|
| | |
|
| | | public class H0102_tagCDBPlayer : GameNetPackBasic {
|
| | |
| | | public uint GoldPaper; //金票
|
| | | public uint Silver; //银子
|
| | | public uint SilverPaper; //银票
|
| | | public uint FightPoint; //战斗值
|
| | | public uint FightPoint; //锤子倍数,非战斗力
|
| | | public uint HappyPoint; //
|
| | | public byte LineID; //角色所在线路
|
| | | public ushort MapID; //角色所在地图
|
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A7 20 创角奖励领奖状态 #tagMCCreateRoleAwardState
|
| | |
|
| | | public class HA720_tagMCCreateRoleAwardState : GameNetPackBasic {
|
| | | public byte GetState; // 是否已领取
|
| | |
|
| | | public HA720_tagMCCreateRoleAwardState () {
|
| | | _cmd = (ushort)0xA720;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out GetState, vBytes, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
copy from Main/Component/UI/Common/FuncEnable.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HA7_Interaction/HA720_tagMCCreateRoleAwardState.cs.meta
File was copied from Main/Component/UI/Common/FuncEnable.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e034d1a3f772bb44bbbcd4273f5084e1 |
| | | timeCreated: 1516430103 |
| | | licenseType: Free |
| | | guid: 08539c9fea3d3ba46a95b13662b704ac |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B1 21 仙树信息 #tagMCTreeInfo
|
| | |
|
| | | public class HB121_tagMCTreeInfo : GameNetPackBasic {
|
| | | public byte TreeLV; // 当前仙树等级
|
| | | public byte LVUPState; // 0-非升级中;1-升级中
|
| | | public uint LVUPRemainTime; // 升级剩余时间,秒;当升级中且倒计时为0时可发送B223执行升级包进行升级
|
| | | public byte FreeTimeCnt; // 今日已免费减时次数
|
| | | public uint FreeTimeLast; // 上次免费减时时间戳
|
| | |
|
| | | public HB121_tagMCTreeInfo () {
|
| | | _cmd = (ushort)0xB121;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out TreeLV, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out LVUPState, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out LVUPRemainTime, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out FreeTimeCnt, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out FreeTimeLast, vBytes, NetDataType.DWORD);
|
| | | }
|
| | |
|
| | | }
|
copy from Main/Component/UI/Common/FuncEnable.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HB1_Role/HB121_tagMCTreeInfo.cs.meta
File was copied from Main/Component/UI/Common/FuncEnable.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e034d1a3f772bb44bbbcd4273f5084e1 |
| | | timeCreated: 1516430103 |
| | | licenseType: Free |
| | | guid: 5d4fec1aa2a73b64086988aef86ec5c6 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | |
| | | Debug.Log("切换到登录场景");
|
| | | ConfigManager.Instance.Init();
|
| | | GeneralDefine.Init();
|
| | | #if UNITY_EDITOR
|
| | | SysNotifyMgr.Instance.BeforePlayerDataInitializeEvent();
|
| | | #endif
|
| | | StageManager.Instance.ToLoginScene();
|
| | |
|
| | | DTC0403_tagPlayerLoginLoadOK.finishedLogin = false;
|
| | |
| | | managers.Add(PlayerMainDate.Instance);
|
| | | managers.Add(HeroUIManager.Instance);
|
| | | managers.Add(InvestModel.Instance);
|
| | | managers.Add(BlessLVManager.Instance);
|
| | | managers.Add(AutoFightModel.Instance);
|
| | |
|
| | | foreach (var manager in managers)
|
| | | {
|
| | |
| | | // m_Json["vipLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString(); |
| | | // m_Json["createTime"] = TimeUtility.CreateSeconds.ToString(); |
| | | // m_Json["familyID"] = PlayerDatas.Instance.baseData.FamilyId.ToString(); |
| | | // m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPoint.ToString(); |
| | | // m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPower.ToString(); |
| | | |
| | | // #if UNITY_IOS |
| | | // m_Json["identifier"] = VersionConfig.Get().bundleIdentifier; |
| | |
| | | // m_Json["vipLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString(); |
| | | // m_Json["createTime"] = time; |
| | | // m_Json["familyID"] = PlayerDatas.Instance.baseData.FamilyId.ToString(); |
| | | // m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPoint.ToString(); |
| | | // m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPower.ToString(); |
| | | // SendMessageToSDK(m_Json); |
| | | } |
| | | |
| | |
| | | // m_Json["vipLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString(); |
| | | // m_Json["createTime"] = TimeUtility.CreateSeconds.ToString(); |
| | | // m_Json["familyID"] = PlayerDatas.Instance.baseData.FamilyId.ToString(); |
| | | // m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPoint.ToString(); |
| | | // m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPower.ToString(); |
| | | // SendMessageToSDK(m_Json); |
| | | } |
| | | |
| | |
| | | m_Json["levelUpTime"] = TimeUtility.AllSeconds.ToString(); |
| | | m_Json["createTime"] = TimeUtility.CreateSeconds.ToString(); |
| | | m_Json["familyID"] = PlayerDatas.Instance.baseData.FamilyId.ToString(); |
| | | m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPoint.ToString(); |
| | | m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPower.ToString(); |
| | | SendMessageToSDK(m_Json); |
| | | } |
| | | |
| | |
| | | m_Json["levelUpTime"] = TimeUtility.AllSeconds.ToString(); |
| | | m_Json["createTime"] = TimeUtility.CreateSeconds.ToString(); |
| | | m_Json["familyID"] = PlayerDatas.Instance.baseData.FamilyId.ToString(); |
| | | m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPoint.ToString(); |
| | | m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPower.ToString(); |
| | | SendMessageToSDK(m_Json); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | // 检查一下锤子的消耗 |
| | | //FightPoint 用于记录消耗战锤倍数,小于等于1时默认1倍,大于1时为对应消耗倍值,0418刷新类型22 |
| | | //useHarmerCount 用于记录消耗战锤倍数,小于等于1时默认1倍,大于1时为对应消耗倍值,0418刷新类型22 |
| | | BattleDebug.LogError("HandModeOperationAgent DoNext 2"); |
| | | long costRate = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.FightPoint); |
| | | long costRate = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.UseHarmerCount); |
| | | |
| | | long cost = (costRate > 1 ? costRate : 1) * 1; // 1是默认消耗 |
| | | |
| | |
| | | |
| | | public override bool IsFinished() |
| | | { |
| | | if (null == skillBase) |
| | | { |
| | | return true; |
| | | } |
| | | return skillBase.IsFinished(); |
| | | } |
| | | |
| | |
| | | |
| | | // 目前支持 BYTE ReqType; // 0-停止战斗回城;1-设置消耗倍值;2-挑战关卡小怪;3-挑战关卡boss;4-继续战斗; |
| | | // 0-停止战斗回城 - 玩家主动点击回城时发送 |
| | | // 1-设置消耗倍值 - 玩家设置消耗倍值,对应到玩家FightPoint的值 |
| | | // 1-设置消耗倍值 - 玩家设置消耗倍值,对应到玩家useHarmerCount的值 |
| | | // 2-挑战关卡小怪 - 玩家点击开始战斗时发送,仅从休息状态到开始战斗时发送即可 |
| | | // 3-挑战关卡boss - 玩家请求挑战该关卡boss时发送 |
| | | // 4-继续战斗 - 玩家主线战斗中(包含主线小怪、主线boss),前端表现完后端同步的战斗片段后,可再回复该值,后端会根据战斗逻辑及流程自动回复下一段的战斗片段封包,一直循环 |
| | |
| | | if (anim == null) |
| | | { |
| | | BattleDebug.LogError($"找不到动画: {skillConfig.SkillMotionName}"); |
| | | _onComplete?.Invoke(); |
| | | return null; |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | return Language.Get(dungeonRandomChats[1], PlayerDatas.Instance.baseData.FightPoint); |
| | | return Language.Get(dungeonRandomChats[1], PlayerDatas.Instance.baseData.FightPower); |
| | | } |
| | | case ChatInfoType.Fairy: |
| | | return Language.Get(realmRandomChats[_index]); |
| | |
| | | for (int i = 0; i < act.ctgIDs.Count; i++) |
| | | { |
| | | int ctgID = act.ctgIDs[i]; |
| | | RechargeManager.RechargeCount rechargeCount; |
| | | RechargeCount rechargeCount; |
| | | if (RechargeManager.Instance.TryGetRechargeCount(ctgID, out rechargeCount)) |
| | | { |
| | | total += rechargeCount.totalCount; |
| | |
| | | OperationRechargeGiftAct act; |
| | | OperationTimeHepler.Instance.TryGetOperation(operaType, out act); |
| | | |
| | | RechargeManager.RechargeCount rechargeCount; |
| | | RechargeCount rechargeCount; |
| | | RechargeManager.Instance.TryGetRechargeCount(ctgID, out rechargeCount); |
| | | |
| | | var ctgConfig = CTGConfig.Get(ctgID); |
| | |
| | | if (!RechargeManager.Instance.TryGetRechargeItem(ctgId, out awards))
|
| | | return false;
|
| | |
|
| | | RechargeManager.RechargeCount rechargeCount;
|
| | | RechargeCount rechargeCount;
|
| | | if (!RechargeManager.Instance.TryGetRechargeCount(ctgId, out rechargeCount))
|
| | | {
|
| | | return false;
|
| | |
| | |
|
| | | public void InitChoose()
|
| | | {
|
| | | RechargeManager.RechargeCount rechargeCount;
|
| | | RechargeCount rechargeCount;
|
| | | RechargeManager.Instance.TryGetRechargeCount(chooseCTGID, out rechargeCount);
|
| | |
|
| | | var selectedItemIndexs = CustomizedRechargeModel.Instance.GetSelectedItems(rechargeCount.selectItemValue);
|
| | |
| | | int goodsSumCount; //商品总数量
|
| | | List<Item> awards = new List<Item>();
|
| | | TryGetRechargeItemEx(ctgID, out awards, out goodsCount, out goodsSumCount);
|
| | | RechargeManager.RechargeCount rechargeCount;
|
| | | RechargeCount rechargeCount;
|
| | | RechargeManager.Instance.TryGetRechargeCount(ctgID, out rechargeCount);
|
| | | for (int i = 0; i < itemCells.Count; i++)
|
| | | {
|
New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | public class BlessLVCell : CellView |
| | | { |
| | | [SerializeField] Text qualityName; |
| | | [SerializeField] Text qualityRate; |
| | | [SerializeField] Text qualityNextRate; |
| | | [SerializeField] Image qualityIcon; |
| | | |
| | | [SerializeField] OutlineEx qualityNameOutline; |
| | | |
| | | |
| | | public void Display(int index) |
| | | { |
| | | var startQuality = BlessLVManager.Instance.GetStartEquipQuality(); |
| | | var config = TreeLVConfig.Get(BlessLVManager.Instance.m_TreeLV); |
| | | var nextConfig = TreeLVConfig.Get(BlessLVManager.Instance.m_TreeLV + 1); |
| | | var quality = startQuality + index; |
| | | qualityName.text = Language.Get("equipQuality" + quality); |
| | | qualityName.color = UIHelper.GetUIColor(quality); |
| | | |
| | | float rate = 0; |
| | | if (config != null) |
| | | { |
| | | if (quality - 1 < config.EquipColorRateList.Length) |
| | | rate = config.EquipColorRateList[quality - 1] / 100.0f; |
| | | } |
| | | qualityRate.text = rate + "%"; |
| | | if (nextConfig != null) |
| | | { |
| | | if (quality - 1 < nextConfig.EquipColorRateList.Length) |
| | | rate = nextConfig.EquipColorRateList[quality - 1] / 100.0f; |
| | | } |
| | | qualityNextRate.text = rate + "%"; |
| | | qualityIcon.SetSprite("TreeItemQuality_" + quality); |
| | | qualityNameOutline.OutlineColor = UIHelper.GetUIOutlineColor(quality); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
copy from Main/Component/UI/Common/FuncEnable.cs.meta
copy to Main/System/Equip/BlessLVCell.cs.meta
File was copied from Main/Component/UI/Common/FuncEnable.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e034d1a3f772bb44bbbcd4273f5084e1 |
| | | timeCreated: 1516430103 |
| | | licenseType: Free |
| | | guid: bcbe9f8e3b41b3049be9a08f505fde26 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using System; |
| | | |
| | | |
| | | public class BlessLVManager : GameSystemManager<BlessLVManager> |
| | | { |
| | | public int m_TreeLV { get; private set; } // 当前仙树等级 |
| | | public int m_LVUPState { get; private set; } // 0-非升级中;1-升级中 |
| | | public int m_LVUPRemainTime { get; private set; } // 升级剩余时间,秒;当升级中且倒计时为0时可发送B223执行升级包进行升级 |
| | | public int m_FreeTimeCnt { get; private set; } // 今日已免费减时次数 |
| | | public int m_FreeTimeLast { get; private set; } // 上次免费减时时间戳 |
| | | public event Action OnBlessLVUpdateEvent; |
| | | int m_LVPackTime; //收包时间用于计算剩余时间m_LVUPRemainTime |
| | | |
| | | public int upgradeTreeMoneyType; //升级仙树消耗的货币类型 |
| | | public int timeUpTreeItemID; //加速仙树升级的道具ID |
| | | public int timeUpTreeItemSubTime; //减少仙树升级时间的道具减少的时间 |
| | | public int dayFreeMaxTimes; //每日免费升级次数 |
| | | public int freeTimeCD; //免费减少时间的冷却CD 分 |
| | | public int freeSubTime; //免费减少的时间 分 |
| | | |
| | | public int lastTreeLV; //上一次树的等级 用于打开界面的时候播放下升级特效 |
| | | |
| | | public override void Init() |
| | | { |
| | | m_TreeLV = 0; |
| | | m_LVUPState = 0; |
| | | m_LVUPRemainTime = 0; |
| | | m_LVPackTime = 0; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOK; |
| | | GlobalTimeEvent.Instance.fiveSecondEvent += OnTimeEvent; |
| | | |
| | | ParseConfig(); |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOK; |
| | | GlobalTimeEvent.Instance.fiveSecondEvent -= OnTimeEvent; |
| | | } |
| | | |
| | | void OnPlayerLoginOK() |
| | | { |
| | | lastTreeLV = 0; |
| | | AutoUpgrade(); |
| | | UpdateTreeRedpoint(); |
| | | } |
| | | |
| | | |
| | | void ParseConfig() |
| | | { |
| | | var config = FuncConfigConfig.Get("TreeLVUP"); |
| | | upgradeTreeMoneyType = int.Parse(config.Numerical1); |
| | | var arr = config.Numerical2.Split('|'); |
| | | timeUpTreeItemID = int.Parse(arr[0]); |
| | | timeUpTreeItemSubTime = int.Parse(arr[1]); |
| | | dayFreeMaxTimes = int.Parse(config.Numerical3); |
| | | freeTimeCD = int.Parse(config.Numerical4); |
| | | freeSubTime = int.Parse(config.Numerical5); |
| | | } |
| | | |
| | | public void UpdateBlessLVInfo(HB121_tagMCTreeInfo netPack) |
| | | { |
| | | m_TreeLV = netPack.TreeLV; |
| | | m_LVUPState = netPack.LVUPState; |
| | | m_LVUPRemainTime = (int)netPack.LVUPRemainTime; |
| | | m_FreeTimeCnt = netPack.FreeTimeCnt; |
| | | m_FreeTimeLast = (int)netPack.FreeTimeLast; |
| | | m_LVPackTime = TimeUtility.AllSeconds; |
| | | if (lastTreeLV == 0) |
| | | { |
| | | lastTreeLV = m_TreeLV; |
| | | } |
| | | OnBlessLVUpdateEvent?.Invoke(); |
| | | UpdateTreeRedpoint(); |
| | | AutoUpgrade(); |
| | | } |
| | | |
| | | public int GetLVUPRemainTime() |
| | | { |
| | | if (m_LVUPState == 0) |
| | | return 0; |
| | | return m_LVUPRemainTime - (TimeUtility.AllSeconds - m_LVPackTime); |
| | | } |
| | | |
| | | public int GetFreeRemainTime() |
| | | { |
| | | if (m_LVUPState == 0) |
| | | return 0; |
| | | return m_FreeTimeLast + freeTimeCD * 60 - TimeUtility.AllSeconds; |
| | | } |
| | | |
| | | Redpoint redpointTree = new Redpoint(MainRedDot.BlessLVRedpoint); |
| | | Redpoint redpointTreeItem = new Redpoint(MainRedDot.BlessLVRedpoint, MainRedDot.BlessLVRedpoint * 10); |
| | | Redpoint redpointTreeFree = new Redpoint(MainRedDot.BlessLVRedpoint, MainRedDot.BlessLVRedpoint * 10 + 1); |
| | | void UpdateTreeRedpoint() |
| | | { |
| | | redpointTreeFree.state = RedPointState.None; |
| | | redpointTreeItem.state = RedPointState.None; |
| | | redpointTree.state = RedPointState.None; |
| | | var config = TreeLVConfig.Get(m_TreeLV); |
| | | if (config == null) return; |
| | | //非升级中检查升级材料 |
| | | if (m_LVUPState == 0) |
| | | { |
| | | |
| | | if (UIHelper.GetMoneyCnt(upgradeTreeMoneyType) >= config.LVUPNeedMoney) |
| | | { |
| | | redpointTree.state = RedPointState.Simple; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //检查时间道具 和 免费的时间 |
| | | if (PackManager.Instance.GetSinglePack(PackType.Item).HasItem(timeUpTreeItemID)) |
| | | { |
| | | redpointTreeItem.state = RedPointState.Simple; |
| | | return; |
| | | } |
| | | if (m_FreeTimeCnt > 0 && GetFreeRemainTime() <= 0) |
| | | { |
| | | redpointTreeFree.state = RedPointState.Simple; |
| | | return; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | public void AutoUpgrade() |
| | | { |
| | | //时间结束自动通知服务端升级,或者打开界面时,或者上线 都做检查 |
| | | if (m_LVUPState == 0) |
| | | { |
| | | return; |
| | | } |
| | | if (GetLVUPRemainTime() > 0) |
| | | { |
| | | return; |
| | | } |
| | | var pack = new CB223_tagCMTreeLVUP(); |
| | | pack.Type = 1; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | |
| | | void OnTimeEvent() |
| | | { |
| | | //升级中检查 倒计时结束;非升级中检查免费次数时间 红点 |
| | | if (m_LVUPState == 1) |
| | | { |
| | | //升级 |
| | | AutoUpgrade(); |
| | | } |
| | | |
| | | UpdateTreeRedpoint(); |
| | | |
| | | } |
| | | |
| | | |
| | | //装备品质的起始表现,最小1 |
| | | public int GetStartEquipQuality() |
| | | { |
| | | var rateList = TreeLVConfig.Get(m_TreeLV).EquipColorRateList; |
| | | for (int i = 0; i < rateList.Length; i++) |
| | | { |
| | | if (rateList[i] != 0) |
| | | return i + 1; |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
copy from Main/Component/UI/Common/FuncEnable.cs.meta
copy to Main/System/Equip/BlessLVManager.cs.meta
File was copied from Main/Component/UI/Common/FuncEnable.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e034d1a3f772bb44bbbcd4273f5084e1 |
| | | timeCreated: 1516430103 |
| | | licenseType: Free |
| | | guid: 4ec372b43a4e10e4798aa452c7c1f6aa |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
New file |
| | |
| | | |
| | | |
| | | using System; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class BlessLVTimeUpWin : UIBase |
| | | { |
| | | [SerializeField] ItemCell itemCell; |
| | | [SerializeField] Text itemCntTxt; |
| | | [SerializeField] LongPressButton subBtn; |
| | | [SerializeField] LongPressButton addBtn; |
| | | [SerializeField] Text timeText; |
| | | [SerializeField] Button speedBtn; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | addBtn.SetListener(OnClickPlus); |
| | | addBtn.onPress.AddListener(OnClickPlus); |
| | | subBtn.SetListener(OnClickReduce); |
| | | subBtn.onPress.AddListener(OnClickReduce); |
| | | speedBtn.AddListener(OnSpeedUP); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | int count = (int)PackManager.Instance.GetItemCountByID(PackType.Item, BlessLVManager.Instance.timeUpTreeItemID); |
| | | itemCell.Init(new ItemCellModel(BlessLVManager.Instance.timeUpTreeItemID, false, count)); |
| | | itemCell.button.AddListener(() => |
| | | { |
| | | ItemTipUtility.Show(BlessLVManager.Instance.timeUpTreeItemID); |
| | | }); |
| | | |
| | | var remainTime = BlessLVManager.Instance.GetLVUPRemainTime(); |
| | | int needCount = (int)Math.Ceiling((float)remainTime / BlessLVManager.Instance.timeUpTreeItemSubTime); |
| | | showCount = Math.Min(count, needCount); |
| | | RefreshCount(needCount, remainTime); |
| | | RefreshBtn(showCount); |
| | | } |
| | | |
| | | int showCount; |
| | | void RefreshCount(int needCount, int remainTime) |
| | | { |
| | | |
| | | itemCntTxt.text = showCount + "/" + needCount; |
| | | timeText.text = Language.Get("L1100", Language.Get("BlessTree8"), TimeUtility.SecondsToDHMSEx(remainTime)) + |
| | | UIHelper.AppendColor(TextColType.DarkGreen, "(" + TimeUtility.SecondsToDHMSEx(showCount * BlessLVManager.Instance.timeUpTreeItemSubTime) + ")"); |
| | | |
| | | } |
| | | |
| | | void RefreshBtn(int maxCount) |
| | | { |
| | | if (showCount >= maxCount) |
| | | { |
| | | addBtn.interactable = false; |
| | | addBtn.SetColorful(null, false); |
| | | } |
| | | else |
| | | { |
| | | addBtn.interactable = true; |
| | | addBtn.SetColorful(null, true); |
| | | } |
| | | |
| | | if (showCount == 0) |
| | | { |
| | | subBtn.interactable = false; |
| | | subBtn.SetColorful(null, false); |
| | | } |
| | | else |
| | | { |
| | | subBtn.interactable = true; |
| | | subBtn.SetColorful(null, true); |
| | | } |
| | | } |
| | | |
| | | |
| | | void OnClickPlus() |
| | | { |
| | | int count = (int)PackManager.Instance.GetItemCountByID(PackType.Item, BlessLVManager.Instance.timeUpTreeItemID); |
| | | var remainTime = BlessLVManager.Instance.GetLVUPRemainTime(); |
| | | int needCount = (int)Math.Ceiling((float)remainTime / BlessLVManager.Instance.timeUpTreeItemSubTime); |
| | | if (showCount == Math.Min(count, needCount)) |
| | | return; |
| | | showCount++; |
| | | RefreshCount(needCount, remainTime); |
| | | RefreshBtn(Math.Min(count, needCount)); |
| | | } |
| | | |
| | | void OnClickReduce() |
| | | { |
| | | if (showCount == 0) |
| | | return; |
| | | var remainTime = BlessLVManager.Instance.GetLVUPRemainTime(); |
| | | showCount--; |
| | | itemCntTxt.text = showCount.ToString(); |
| | | int needCount = (int)Math.Ceiling((float)remainTime / BlessLVManager.Instance.timeUpTreeItemSubTime); |
| | | RefreshCount(needCount, remainTime); |
| | | |
| | | int count = (int)PackManager.Instance.GetItemCountByID(PackType.Item, BlessLVManager.Instance.timeUpTreeItemID); |
| | | RefreshBtn(Math.Min(count, needCount)); |
| | | } |
| | | |
| | | void OnSpeedUP() |
| | | { |
| | | var pack = new CB224_tagCMUseTreeLVUPTimeItem(); |
| | | pack.UseCount = (uint)showCount; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | CloseWindow(); |
| | | } |
| | | } |
| | | |
| | | |
copy from Main/Component/UI/Common/FuncEnable.cs.meta
copy to Main/System/Equip/BlessLVTimeUpWin.cs.meta
File was copied from Main/Component/UI/Common/FuncEnable.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e034d1a3f772bb44bbbcd4273f5084e1 |
| | | timeCreated: 1516430103 |
| | | licenseType: Free |
| | | guid: 71aa0a65d75dea04c9bded1f9bc01fc3 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
New file |
| | |
| | | |
| | | using System; |
| | | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | public class BlessLVWin : UIBase |
| | | { |
| | | [SerializeField] Text curLVTxt; |
| | | [SerializeField] Text nextLVTxt; |
| | | [SerializeField] ScrollerController scroller; |
| | | [SerializeField] Text leftTime; |
| | | [SerializeField] Transform upgradeOnState; //升级中按钮 |
| | | [SerializeField] Text itemCntTxt; |
| | | [SerializeField] Image itemIcon; |
| | | [SerializeField] Button timeUpBtn; //加速时间按钮 |
| | | [SerializeField] Button freeBtn; |
| | | [SerializeField] Text freeLeftTime; |
| | | |
| | | [SerializeField] Transform upgradeWaiteState; //待升级 |
| | | [SerializeField] Image processImg; //进度 |
| | | [SerializeField] Text moneyText; |
| | | [SerializeField] Image moneyTypeImg; |
| | | [SerializeField] Button upgradeButton; |
| | | [SerializeField] UIEffectPlayer upgradeEffect; |
| | | [SerializeField] UIEffectPlayer btnEffect; |
| | | |
| | | |
| | | |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | |
| | | timeUpBtn.AddListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<BlessLVTimeUpWin>(); |
| | | }); |
| | | |
| | | upgradeButton.AddListener(OnUpgrade); |
| | | |
| | | freeBtn.AddListener(() => |
| | | { |
| | | var pack = new CA504_tagCMPlayerGetReward(); |
| | | pack.RewardType = 82; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | }); |
| | | } |
| | | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | BlessLVManager.Instance.OnBlessLVUpdateEvent += Display; |
| | | PlayerDatas.Instance.playerDataRefreshEvent += OnPlayerDataRefreshEvent; |
| | | GlobalTimeEvent.Instance.secondEvent += OnTimeEvent; |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | | CreateScroller(); |
| | | Display(); |
| | | BlessLVManager.Instance.AutoUpgrade(); |
| | | } |
| | | |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | BlessLVManager.Instance.OnBlessLVUpdateEvent -= Display; |
| | | PlayerDatas.Instance.playerDataRefreshEvent -= OnPlayerDataRefreshEvent; |
| | | GlobalTimeEvent.Instance.secondEvent -= OnTimeEvent; |
| | | scroller.OnRefreshCell -= OnRefreshCell; |
| | | } |
| | | |
| | | |
| | | void DisplayLVUPEffect() |
| | | { |
| | | if (BlessLVManager.Instance.lastTreeLV != BlessLVManager.Instance.m_TreeLV) |
| | | { |
| | | BlessLVManager.Instance.lastTreeLV = BlessLVManager.Instance.m_TreeLV; |
| | | upgradeEffect.Play(); |
| | | } |
| | | else |
| | | { |
| | | upgradeEffect.Stop(); |
| | | } |
| | | } |
| | | |
| | | void OnTimeEvent() |
| | | { |
| | | if (BlessLVManager.Instance.m_LVUPState == 1) |
| | | { |
| | | if (BlessLVManager.Instance.GetLVUPRemainTime() > 0) |
| | | { |
| | | TimeUpShow(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | void Display() |
| | | { |
| | | curLVTxt.text = Language.Get("L1100", Language.Get("BlessTree2"), BlessLVManager.Instance.m_TreeLV); |
| | | nextLVTxt.text = Language.Get("L1100", Language.Get("BlessTree3"), BlessLVManager.Instance.m_TreeLV + 1); |
| | | var config = TreeLVConfig.Get(BlessLVManager.Instance.m_TreeLV); |
| | | itemIcon.SetItemSprite(BlessLVManager.Instance.timeUpTreeItemID); |
| | | |
| | | //待升级 |
| | | if (BlessLVManager.Instance.m_LVUPState == 0) |
| | | { |
| | | upgradeOnState.SetActive(false); |
| | | upgradeWaiteState.SetActive(true); |
| | | leftTime.text = Language.Get("L1100", Language.Get("BlessTree8"), TimeUtility.SecondsToDHMSEx(config.LVUPNeedTime)); |
| | | ShowMoney(); |
| | | moneyTypeImg.SetIconWithMoneyType(BlessLVManager.Instance.upgradeTreeMoneyType); |
| | | } |
| | | else |
| | | { |
| | | upgradeOnState.SetActive(true); |
| | | upgradeWaiteState.SetActive(false); |
| | | TimeUpShow(); |
| | | } |
| | | DisplayLVUPEffect(); |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | void TimeUpShow() |
| | | { |
| | | var remainTime = BlessLVManager.Instance.GetLVUPRemainTime(); |
| | | leftTime.text = Language.Get("L1100", Language.Get("BlessTree8"), TimeUtility.SecondsToDHMSEx(remainTime)); |
| | | long itemCnt = PackManager.Instance.GetItemCountByID(PackType.Item, BlessLVManager.Instance.timeUpTreeItemID); |
| | | int needCount = (int)Math.Ceiling((float)remainTime / BlessLVManager.Instance.timeUpTreeItemSubTime); |
| | | itemCntTxt.text = itemCnt + "/" + needCount; |
| | | itemCntTxt.color = itemCnt >= needCount ? UIHelper.GetUIColor(TextColType.Green, true) : UIHelper.GetUIColor(TextColType.Red, true); |
| | | |
| | | if (BlessLVManager.Instance.m_FreeTimeCnt < BlessLVManager.Instance.dayFreeMaxTimes) |
| | | { |
| | | var freeeRemainTime = BlessLVManager.Instance.GetFreeRemainTime(); |
| | | if (freeeRemainTime > 0) |
| | | { |
| | | freeLeftTime.text = TimeUtility.SecondsToHMS(freeeRemainTime); |
| | | freeBtn.interactable = false; |
| | | } |
| | | else |
| | | { |
| | | freeLeftTime.text = ""; |
| | | freeBtn.interactable = true; |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | freeLeftTime.text = ""; |
| | | freeBtn.interactable = false; |
| | | } |
| | | } |
| | | |
| | | void CreateScroller() |
| | | { |
| | | scroller.Refresh(); |
| | | for (int i = 0; i < 9; i++) |
| | | { |
| | | scroller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | scroller.Restart(); |
| | | } |
| | | |
| | | void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell as BlessLVCell; |
| | | _cell.Display(cell.index); |
| | | } |
| | | |
| | | private void OnPlayerDataRefreshEvent(PlayerDataType type) |
| | | { |
| | | if (type == UIHelper.moneyTypeToPlayerDataType[BlessLVManager.Instance.upgradeTreeMoneyType]) |
| | | { |
| | | ShowMoney(); |
| | | } |
| | | } |
| | | |
| | | |
| | | void ShowMoney() |
| | | { |
| | | var config = TreeLVConfig.Get(BlessLVManager.Instance.m_TreeLV); |
| | | string needMoney = config.LVUPNeedMoney.ToString(); |
| | | if (config.LVUPNeedMoney >= 1000000) |
| | | needMoney = UIHelper.ReplaceLargeNum(config.LVUPNeedMoney); |
| | | |
| | | long lsMoney = UIHelper.GetMoneyCnt(BlessLVManager.Instance.upgradeTreeMoneyType); |
| | | string money = lsMoney.ToString(); |
| | | if (lsMoney >= 1000000) |
| | | money = UIHelper.ReplaceLargeNum(lsMoney); |
| | | |
| | | moneyText.text = money + "/" + needMoney; |
| | | // moneyText.color = lsMoney >= config.LVUPNeedMoney ? UIHelper.GetUIColor(TextColType.Green, true) : UIHelper.GetUIColor(TextColType.Red, true); |
| | | moneyTypeImg.SetIconWithMoneyType(BlessLVManager.Instance.upgradeTreeMoneyType); |
| | | processImg.fillAmount = (float)lsMoney / config.LVUPNeedMoney; |
| | | if (lsMoney >= config.LVUPNeedMoney) |
| | | btnEffect.Play(); |
| | | else |
| | | btnEffect.Stop(); |
| | | } |
| | | |
| | | void OnUpgrade() |
| | | { |
| | | var config = TreeLVConfig.Get(BlessLVManager.Instance.m_TreeLV); |
| | | if (config.LVUPNeedMoney > UIHelper.GetMoneyCnt(BlessLVManager.Instance.upgradeTreeMoneyType)) |
| | | { |
| | | ItemTipUtility.ShowMoneyTip(BlessLVManager.Instance.upgradeTreeMoneyType); |
| | | return; |
| | | } |
| | | |
| | | var pack = new CB223_tagCMTreeLVUP(); |
| | | pack.Type = 0; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | } |
| | | |
| | | |
copy from Main/Component/UI/Common/FuncEnable.cs.meta
copy to Main/System/Equip/BlessLVWin.cs.meta
File was copied from Main/Component/UI/Common/FuncEnable.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e034d1a3f772bb44bbbcd4273f5084e1 |
| | | timeCreated: 1516430103 |
| | | licenseType: Free |
| | | guid: e9b4d07c3a38a1b4cb30eea29e82efa5 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | |
| | | public class EquipModel : GameSystemManager<EquipModel> |
| | | { |
| | | public const int TotleEquip = 12; //装备栏大小 |
| | | public bool waitEquipOPPack = false; |
| | | public bool waitEquipOPPack = false; // 穿戴装备的操作 不含分解 |
| | | public event Action<bool, int> OnEquipOPResultAction; //是否换上了新装备且分解了 装备索引 |
| | | public event Action<List<int>, RectTransform> OnItemDropEvent; |
| | | |
| | |
| | | public int[] equipUIGirdEffects; //装备格子特效 |
| | | public ItemModel selectFloorEquip; //选中的地板装备 |
| | | public int lastShowEquipIndex = -1; //上一次界面显示装备的索引,拾取后物品消失需记录下做表现 |
| | | public Queue<int> waitEquipOP = new Queue<int>(); //等待操作的装备,需要和UI交互确认 |
| | | public Queue<int> waitEquipOP = new Queue<int>(); //等待操作的装备,需要和UI交互确认 不含分解 |
| | | |
| | | public override void Init() |
| | | { |
| | |
| | | // if (!IsEquip(equip)) |
| | | // return false; |
| | | |
| | | if (AutoFightModel.Instance.TryAutoFightDoEquip(equip)) |
| | | { |
| | | //自动战力对比, 条件不满足的分解 |
| | | return false; |
| | | } |
| | | |
| | | // 好几件装备需要处理的情况存起来 |
| | | waitEquipOP.Enqueue(equip.gridIndex); |
| | | //未回复装备操作结果,否则会显示旧装备 |
| | | if (waitEquipOPPack) |
| | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | selectFloorEquip = GetSelectFloorEquip(); |
| | | if (selectFloorEquip == null) |
| | | return false; |
| | | |
| | | UIManager.Instance.OpenWindow<EquipExchangeWin>(); |
| | | |
| | | return true; |
| | | |
| | | } |
| | |
| | | if (waitEquipOP.Count == 0) |
| | | return null; |
| | | |
| | | ItemModel item = PackManager.Instance.GetItemByIndex(PackType.DropItem, waitEquipOP.Dequeue()); |
| | | if (AutoFightModel.Instance.isAutoAttack) |
| | | { |
| | | //自动战力对比, 条件不满足的分解 |
| | | return null; |
| | | return PackManager.Instance.GetItemByIndex(PackType.DropItem, waitEquipOP.Dequeue()); |
| | | |
| | | } |
| | | |
| | | return item; |
| | | } |
| | | |
| | | |
| | | |
| | | //等级 |
| | | public int GetEquipLV(ItemModel equip) |
| | | { |
| | |
| | | public static Dictionary<int, int> MoneyDisplayModel { get; private set; } |
| | | public static int playerMaxLevel { get; private set; } |
| | | |
| | | public static Dictionary<int, int> moneyDisplayIds { get; private set; } |
| | | public static int expDisplayId { get; private set; } |
| | | |
| | | |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 265bf40707a44a641a810b3c675326d3 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | /// <summary> |
| | | /// 公会基础界面 |
| | | /// </summary> |
| | | public class GuildBaseWin : UIBase |
| | | { |
| | | [SerializeField] Button rankBtn; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | |
| | | } |
| | | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | } |
| | | |
| | | |
| | | public override void Refresh() |
| | | { |
| | | |
| | | } |
| | | |
| | | |
| | | } |
copy from Main/Component/UI/Common/FuncEnable.cs.meta
copy to Main/System/Guild/GuildBaseWin.cs.meta
File was copied from Main/Component/UI/Common/FuncEnable.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e034d1a3f772bb44bbbcd4273f5084e1 |
| | | timeCreated: 1516430103 |
| | | licenseType: Free |
| | | guid: 3511d1c6da8ad9048ab85f89b04f9078 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += UpdateFuncState;
|
| | | PackManager.Instance.RefreshItemEvent += RefreshXBTool;
|
| | | TimeMgr.Instance.OnDayEvent += OnDayEvent;
|
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk;
|
| | | InvestModel.Instance.onInvestUpdate += OnInvestUpdate;
|
| | |
|
| | | xbGetItemDict.Clear();
|
| | | xbTypeItemDict.Clear();
|
| | |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= UpdateFuncState;
|
| | | PackManager.Instance.RefreshItemEvent -= RefreshXBTool;
|
| | | TimeMgr.Instance.OnDayEvent -= OnDayEvent;
|
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk;
|
| | | InvestModel.Instance.onInvestUpdate -= OnInvestUpdate;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | isXBCoolTime = false;
|
| | | xbTypeInfoDict.Clear();
|
| | | }
|
| | |
|
| | | void OnPlayerLoginOk()
|
| | | {
|
| | | HeroCallRedPoint();
|
| | | }
|
| | |
|
| | |
|
| | | void OnInvestUpdate(int type)
|
| | | {
|
| | | if (type == 7)
|
| | | HeroCallRedPoint();
|
| | | }
|
| | | public XBGetItemConfig GetXBItemConfigByType(int type)
|
| | | {
|
| | | int lv = 0;
|
| | |
| | | //货币寻宝
|
| | | int moneyType = funcSet.CostMoneyType;
|
| | | int xbOneMoney = funcSet.CostMoneyList[0];
|
| | |
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= xbOneMoney)
|
| | | //暂定充值货币需要二次确认
|
| | | if (moneyType == 1)
|
| | | {
|
| | | //暂定充值货币需要二次确认
|
| | | if (moneyType == 1)
|
| | | StoreModel.Instance.UseMoneyCheck(xbOneMoney, moneyType, () =>
|
| | | {
|
| | | StoreModel.Instance.UseMoneyCheck(xbOneMoney, moneyType, () =>
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= xbOneMoney)
|
| | | {
|
| | | SendXBQuest(xbType, 0, 0);
|
| | | }, (int)BuyStoreItemCheckType.HeroCall, fullTip: Language.Get("CostMoneyForItem", funcSet.CostItemID, xbOneMoney,
|
| | | UIHelper.GetIconNameWithMoneyType(moneyType), funcSet.CostItemCountList[0]));
|
| | | }
|
| | | else
|
| | | {
|
| | | ItemTipUtility.ShowMoneyTip(moneyType);
|
| | | }
|
| | | }, (int)BuyStoreItemCheckType.HeroCall, fullTip: Language.Get("CostMoneyForItem", funcSet.CostItemID, xbOneMoney,
|
| | | UIHelper.GetIconNameWithMoneyType(moneyType), funcSet.CostItemCountList[0]));
|
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | | SendXBQuest(xbType, 0, 0);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | ItemTipUtility.ShowMoneyTip(moneyType);
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= xbOneMoney)
|
| | | {
|
| | | SendXBQuest(xbType, 0, 0);
|
| | | }
|
| | | else
|
| | | {
|
| | | ItemTipUtility.ShowMoneyTip(moneyType);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | //货币寻宝
|
| | | int moneyType = funcSet.CostMoneyType;
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= needMoney)
|
| | |
|
| | | //暂定充值货币需要二次确认
|
| | | if (moneyType == 1)
|
| | | {
|
| | | //暂定充值货币需要二次确认
|
| | | if (moneyType == 1)
|
| | | StoreModel.Instance.UseMoneyCheck(needMoney, moneyType, () =>
|
| | | {
|
| | | StoreModel.Instance.UseMoneyCheck(needMoney, moneyType, () =>
|
| | | //只要有道具就是道具寻宝,不足部分服务端扣货币
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= needMoney)
|
| | | {
|
| | | //只要有道具就是道具寻宝,不足部分服务端扣货币
|
| | | SendXBQuest(xbType, 1, toolCnt > 0 ? 2 : 0);
|
| | | }, (int)BuyStoreItemCheckType.HeroCall, fullTip: Language.Get("CostMoneyForItem", funcSet.CostItemID, needMoney,
|
| | | UIHelper.GetIconNameWithMoneyType(moneyType), needToolCnt - toolCnt));
|
| | | }
|
| | | else
|
| | | {
|
| | | SendXBQuest(xbType, 1, toolCnt > 0 ? 2 : 0);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | ItemTipUtility.ShowMoneyTip(moneyType);
|
| | | }
|
| | | }, (int)BuyStoreItemCheckType.HeroCall, fullTip: Language.Get("CostMoneyForItem", funcSet.CostItemID, needMoney,
|
| | | UIHelper.GetIconNameWithMoneyType(moneyType), needToolCnt - toolCnt));
|
| | | }
|
| | | else
|
| | | {
|
| | | ItemTipUtility.ShowMoneyTip(moneyType);
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= needMoney)
|
| | | {
|
| | | SendXBQuest(xbType, 1, toolCnt > 0 ? 2 : 0);
|
| | | }
|
| | | else
|
| | | {
|
| | | ItemTipUtility.ShowMoneyTip(moneyType);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | #region 红点逻辑
|
| | | public const int HappyXB_RedKey = 203;
|
| | | public const int XBHeroCall1_RedKey = 20300; //武将免费召唤
|
| | | public const int XBHeroCall10_RedKey = 20301; //武将10召唤
|
| | | public const int XBHeroCallScore_RedKey = 20302; //武将积分召唤
|
| | |
|
| | |
|
| | | public Redpoint happyXBRed = new Redpoint(HappyXB_RedKey);
|
| | | public Redpoint happyXBRed = new Redpoint(MainRedDot.MainHerosRedpoint, HappyXB_RedKey);
|
| | | public Redpoint bestXBFreeRed = new Redpoint(HappyXB_RedKey, XBHeroCall1_RedKey);
|
| | | public Redpoint bestXB10Red = new Redpoint(HappyXB_RedKey, XBHeroCall10_RedKey);
|
| | | public Redpoint bestXBScoreRed = new Redpoint(HappyXB_RedKey, XBHeroCallScore_RedKey);
|
| | |
|
| | |
|
| | |
|
| | | private void UpdateFuncState(int funcId)
|
| | |
| | | HeroCallRedPoint();
|
| | | }
|
| | |
|
| | | void OnDayEvent()
|
| | | { |
| | | HeroCallRedPoint();
|
| | | }
|
| | |
|
| | | //英雄招募
|
| | | public void HeroCallRedPoint()
|
| | | {
|
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.HappyFindTreasure)) return;
|
| | | // 免费 10连 积分
|
| | | happyXBRed.state = RedPointState.None;
|
| | | bestXB10Red.state = RedPointState.None;
|
| | | bestXBFreeRed.state = RedPointState.None;
|
| | | bestXBScoreRed.state = RedPointState.None;
|
| | |
|
| | |
|
| | | if (IsHaveFreeXB((int)HappXBTitle.HeroCallAdvanced))
|
| | | {
|
| | | bestXBFreeRed.state = RedPointState.Simple;
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | | bestXBFreeRed.state = RedPointState.None;
|
| | | }
|
| | |
|
| | | if (IsHaveManyXBToolEx((int)HappXBTitle.HeroCallAdvanced, out int xbtoolCnt, out int needtoolCnt, out int needMoney))
|
| | | {
|
| | | happyXBRed.state = RedPointState.Simple;
|
| | | bestXB10Red.state = RedPointState.Simple;
|
| | | return;
|
| | | }
|
| | |
|
| | | //积分足够
|
| | |
|
| | | if ((InvestModel.Instance.IsInvested(InvestModel.monthCardType)
|
| | | || GetXBInfoByType((int)HappXBTitle.HeroCallScore)?.treasureCount == 0)
|
| | | && UIHelper.GetMoneyCnt(51) >= TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0])
|
| | | { |
| | | bestXBScoreRed.state = RedPointState.Simple;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
| | | protected override void OnPreOpen() |
| | | { |
| | | isSkip = LocalSave.GetBool(HeroUIManager.skipKey, false); |
| | | UIManager.Instance.CloseWindow<ScrollTipWin>(); |
| | | HappyXBModel.Instance.RefreshXBResultAct += UpdateState; |
| | | HappyXBModel.Instance.RefreshXBTypeInfoAct += RefreshBtn; |
| | | InitMoney(); |
| | |
| | | { |
| | | var funcSet = TreasureSetConfig.Get((int)HeroUIManager.Instance.selectCallType); |
| | | if (funcSet.CostItemID == 0) |
| | | { |
| | | { |
| | | call1ItemIcon.SetActive(false); |
| | | call1Text.SetActive(false); |
| | | call10ItemIcon.SetActive(false); |
| | |
| | | call1Text.SetActive(true); |
| | | call10ItemIcon.SetActive(true); |
| | | call10Text.SetActive(true); |
| | | |
| | | |
| | | var item = ItemConfig.Get(funcSet.CostItemID); |
| | | var IconKey = item.IconKey; |
| | | call1ItemIcon.SetOrgSprite(IconKey); |
| | | |
| | | var itemCount = PackManager.Instance.GetItemCountByID(PackType.Item, funcSet.CostItemID); |
| | | |
| | | if (HappyXBModel.Instance.IsHaveFreeXB((int)HeroUIManager.Instance.selectCallType)) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | call1Text.text = Language.Get("L1100", item.ItemName, funcSet.CostItemCountList[0]); |
| | | call1Text.text = Language.Get("L1100", item.ItemName, UIHelper.AppendColor(funcSet.CostItemCountList[0] > itemCount ? TextColType.Red : TextColType.LightWhite, funcSet.CostItemCountList[0].ToString())); |
| | | } |
| | | |
| | | |
| | | call10ItemIcon.SetOrgSprite(IconKey); |
| | | call10Text.text = Language.Get("L1100", item.ItemName, funcSet.CostItemCountList[1]); |
| | | call10Text.text = Language.Get("L1100", item.ItemName, UIHelper.AppendColor(funcSet.CostItemCountList[1] > itemCount ? TextColType.Red : TextColType.LightWhite, funcSet.CostItemCountList[1].ToString())); |
| | | |
| | | } |
| | | |
| | | void ShowMoney(bool show) |
| | |
| | | var IconKey = item.IconKey; |
| | | call1ItemIcon.SetOrgSprite(IconKey); |
| | | call10ItemIcon.SetOrgSprite(IconKey); |
| | | var itemCount = PackManager.Instance.GetItemCountByID(PackType.Item, funcSet.CostItemID); |
| | | if (HappyXBModel.Instance.IsHaveFreeXB((int)HappXBTitle.HeroCallAdvanced)) |
| | | { |
| | | call1Text.text = Language.Get("L1127"); |
| | | } |
| | | else |
| | | { |
| | | call1Text.text = Language.Get("L1100", item.ItemName, funcSet.CostItemCountList[0]); |
| | | call1Text.text = Language.Get("L1100", item.ItemName, UIHelper.AppendColor(funcSet.CostItemCountList[0] > itemCount ? TextColType.Red :TextColType.LightWhite, funcSet.CostItemCountList[0].ToString())); |
| | | } |
| | | call10Text.text = Language.Get("L1100", item.ItemName, funcSet.CostItemCountList[1]); |
| | | call10Text.text = Language.Get("L1100", item.ItemName, UIHelper.AppendColor(funcSet.CostItemCountList[1] > itemCount ? TextColType.Red : TextColType.LightWhite, funcSet.CostItemCountList[1].ToString())); |
| | | |
| | | scoreText.text = UIHelper.GetMoneyCnt(51) + "/" + TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0]; |
| | | |
| | |
| | | |
| | | void RefreshFreeTime() |
| | | { |
| | | if (!HappyXBModel.Instance.IsHaveFreeXB((int)HappXBTitle.HeroCallAdvanced)) |
| | | if (HappyXBModel.Instance.IsHaveFreeXB((int)HappXBTitle.HeroCallAdvanced)) |
| | | { |
| | | freeCDTime.SetActive(false); |
| | | } |
| | |
| | | if (hero.heroConfig.FetterIDList.Length > 0) |
| | | { |
| | | connetionForm.SetActive(true); |
| | | connetionForm.Display(hero.heroConfig.FetterIDList[0], Language.Get("herocard40"), true, guid); |
| | | connetionForm.Display(hero.heroConfig.FetterIDList[0], Language.Get("herocard38") + "\n", true, guid); |
| | | } |
| | | else |
| | | { |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6c6d94d09b5fc3546a5cb9c2488e37fa |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | /// <summary> |
| | | /// 内政 |
| | | /// </summary> |
| | | public class AffairBaseWin : UIBase |
| | | { |
| | | [SerializeField] Button bagBtn; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | bagBtn.AddListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<RolePackWin>(); |
| | | } |
| | | ); |
| | | } |
| | | |
| | | } |
copy from Main/Component/UI/Common/FuncEnable.cs.meta
copy to Main/System/InternalAffairs/AffairBaseWin.cs.meta
File was copied from Main/Component/UI/Common/FuncEnable.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e034d1a3f772bb44bbbcd4273f5084e1 |
| | | timeCreated: 1516430103 |
| | | licenseType: Free |
| | | guid: 670c8663456dd724497730fe8b72e23b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | |
| | | |
| | | |
| | | public event Action onSelectUpdate; |
| | | public event Action onInvestUpdate; |
| | | public event Action<int> onInvestUpdate; |
| | | |
| | | public const int redpointID = 20931; |
| | | public Redpoint redpoint = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, redpointID); |
| | |
| | | |
| | | if (onInvestUpdate != null) |
| | | { |
| | | onInvestUpdate(); |
| | | onInvestUpdate(package.InvestType); |
| | | } |
| | | } |
| | | |
| | |
| | | for (int i = 0; i < netPack.MoneyLen; i++)
|
| | | {
|
| | | var moneyType = netPack.MoneyList[i].MoneyType;
|
| | | if (GeneralDefine.moneyDisplayIds.ContainsKey(moneyType) && netPack.MoneyList[i].MoneyValue != 0)
|
| | | if (GeneralDefine.MoneyDisplayModel.ContainsKey(moneyType) && netPack.MoneyList[i].MoneyValue != 0)
|
| | | {
|
| | | showItems.Add(new Item(GeneralDefine.moneyDisplayIds[moneyType], netPack.MoneyList[i].MoneyValue));
|
| | | showItems.Add(new Item(GeneralDefine.MoneyDisplayModel[moneyType], netPack.MoneyList[i].MoneyValue));
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | // InGameDownLoad.Instance.downLoadGo = false; |
| | | // DownloadMgr.MaxDownLoadTask = InGameDownLoad.Instance.GetMaxTask(); |
| | | // }); |
| | | AutoFightModel.Instance.isAutoAttack = false; |
| | | } |
| | | |
| | | protected override void OnOpenAnimationComplete() |
| | |
| | | public override void Refresh() |
| | | { |
| | | base.Refresh(); |
| | | Debug.Log("刷新登录窗口");
|
| | |
|
| | | //打包版本 + 功能版本 + 语言ID
|
| | | Debug.Log("刷新登录窗口"); |
| | | |
| | | //打包版本 + 功能版本 + 语言ID |
| | | verInfo.text = LoginManager.Instance.GetVersionStr(); |
| | | |
| | | var sprite = BuiltInLoader.LoadSprite("TB_DL_Logo"); |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using LitJson; |
| | | |
| | | using UnityEngine; |
| | | public class AutoFightModel : GameSystemManager<AutoFightModel> |
| | | { |
| | | public int fightSpeed = 1; //战斗倍数:值越大越快,影响战斗表现,掉落速度等 |
| | | //战斗倍数:值越大越快,影响战斗表现,掉落速度等 |
| | | public int fightSpeed |
| | | { |
| | | get |
| | | { |
| | | int value = QuickSetting.Instance.GetQuickSettingValue<int>(QuickSettingType.AutoFight_Speed, 0); |
| | | return Math.Min(Math.Max(value, 1), maxSpeed); |
| | | } |
| | | set |
| | | { |
| | | QuickSetting.Instance.SetQuickSetting(QuickSettingType.AutoFight_Speed, value); |
| | | } |
| | | } |
| | | |
| | | public bool isAutoAttack; //自动攻击 |
| | | //消耗倍数 |
| | | public int fightCost |
| | | { |
| | | get |
| | | { |
| | | int value = QuickSetting.Instance.GetQuickSettingValue<int>(QuickSettingType.AutoFight_Cost, 0); |
| | | return Math.Min(Math.Max(value, 1), maxCost); |
| | | } |
| | | set |
| | | { |
| | | QuickSetting.Instance.SetQuickSetting(QuickSettingType.AutoFight_Cost, value); |
| | | } |
| | | } |
| | | |
| | | //自动模式, 真正点击战锤消耗开启,和休息(或无材料)停止 |
| | | public bool isAutoAttack = false; |
| | | |
| | | //是否开启自动战斗设置 |
| | | public bool isAutoAttackSet |
| | | { |
| | | get |
| | | { |
| | | return QuickSetting.Instance.GetQuickSettingBool(QuickSettingType.AutoFight_Open, 0); |
| | | } |
| | | set |
| | | { |
| | | QuickSetting.Instance.SetQuickSetting(QuickSettingType.AutoFight_Open, value); |
| | | } |
| | | } |
| | | |
| | | //更好装备停止战斗 |
| | | public bool isStopFightByBetterEquip |
| | | { |
| | | get |
| | | { |
| | | return QuickSetting.Instance.GetQuickSettingBool(QuickSettingType.AutoFight_FightPower, 0); |
| | | } |
| | | set |
| | | { |
| | | QuickSetting.Instance.SetQuickSetting(QuickSettingType.AutoFight_FightPower, value); |
| | | } |
| | | } |
| | | |
| | | |
| | | public event Action ChangeAutoEvent; |
| | | |
| | | public int maxSpeed = 3; //最高速度 |
| | | public int maxCost; //最高消耗 |
| | | public int[] autoCostWithBlessLV; //自动战斗消耗倍数关联祝福等级 |
| | | public int speed2UnlockMissionID; |
| | | public int speed3UnlockCTGID; |
| | | public override void Init() |
| | | { |
| | | |
| | | ParseConfig(); |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk; |
| | | } |
| | | |
| | | void ParseConfig() |
| | | { |
| | | var config = FuncConfigConfig.Get("AutoGuaji"); |
| | | autoCostWithBlessLV = JsonMapper.ToObject<int[]>(config.Numerical1); |
| | | speed2UnlockMissionID = int.Parse(config.Numerical2); |
| | | speed3UnlockCTGID = int.Parse(config.Numerical3); |
| | | maxCost = autoCostWithBlessLV.Length; |
| | | } |
| | | |
| | | void OnPlayerLoginOk() |
| | | { |
| | | //登录时有装备的处理 |
| | | } |
| | | |
| | | public void SaveAutoFightSetting() |
| | | { |
| | | if (PlayerDatas.Instance.baseData.UseHarmerCount != fightCost) |
| | | { |
| | | PlayerDatas.Instance.baseData.UseHarmerCount = fightCost; |
| | | BattleManager.Instance.MainFightRequest(1, (uint)fightCost); |
| | | } |
| | | QuickSetting.Instance.SendPackage(); |
| | | ChangeAutoEvent?.Invoke(); |
| | | } |
| | | |
| | | |
| | | //自动处理装备,需要等待穿戴返回false,其他情况返回true |
| | | public bool TryAutoFightDoEquip(ItemModel item) |
| | | { |
| | | if (!isAutoAttack) |
| | | return false; |
| | | |
| | | if (item == null) |
| | | return true; |
| | | |
| | | long showFightPower = FightPowerManager.Instance.GetFightPowerChange(item); |
| | | |
| | | if (showFightPower < 0) |
| | | { |
| | | EquipModel.Instance.SendEquipOP(new ushort[] { (ushort)item.gridIndex }, 1); |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | if (isStopFightByBetterEquip) |
| | | return false; |
| | | |
| | | EquipModel.Instance.SendEquipOP(new ushort[] { (ushort)item.gridIndex }, 1); |
| | | return true; |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | public class AutoFightWin : UIBase |
| | | { |
| | | [SerializeField] Button autoStartBtn; |
| | | [SerializeField] GameObject usingAutoObj; |
| | | [SerializeField] Button autoStopBtn; |
| | | [SerializeField] Button autoSaveBtn; |
| | | |
| | | [SerializeField] Button changeCostBtn; |
| | | [SerializeField] Text costText; |
| | | [SerializeField] Image costArrow; |
| | | [SerializeField] Text costTip; |
| | | [SerializeField] ScrollerController costScroll; |
| | | |
| | | [SerializeField] Button changeSpeedBtn; |
| | | [SerializeField] Text speedText; |
| | | [SerializeField] Image speedArrow; |
| | | [SerializeField] ScrollerController speedScroll; |
| | | |
| | | [SerializeField] Toggle betterEquipToggle; |
| | | |
| | | |
| | | bool isOpenCostScroll = false; |
| | | bool isOpenSpeedScroll = false; |
| | | protected override void InitComponent() |
| | | { |
| | | autoStartBtn.AddListener(OnClickAutoStart); |
| | | autoStopBtn.AddListener(OnClickAutoStop); |
| | | autoSaveBtn.AddListener(OnClickAutoStart); |
| | | |
| | | changeCostBtn.AddListener(() => |
| | | { |
| | | isOpenCostScroll = !isOpenCostScroll; |
| | | costScroll.SetActive(isOpenCostScroll); |
| | | costArrow.transform.localRotation = Quaternion.Euler(0, 0, isOpenCostScroll ? 180 : 0); |
| | | }); |
| | | changeSpeedBtn.AddListener(() => |
| | | { |
| | | isOpenSpeedScroll = !isOpenSpeedScroll; |
| | | speedScroll.SetActive(isOpenSpeedScroll); |
| | | speedArrow.transform.localRotation = Quaternion.Euler(0, 0, isOpenSpeedScroll ? 180 : 0); |
| | | }); |
| | | |
| | | betterEquipToggle.AddListener((bool value) => |
| | | { |
| | | betterEquipToggle.isOn = value; |
| | | }); |
| | | |
| | | costScroll.GetComponent<ClickScreenOtherSpace>().AddListener(() => |
| | | { |
| | | isOpenCostScroll = false; |
| | | costArrow.transform.localRotation = Quaternion.Euler(0, 0, 0); |
| | | }); |
| | | |
| | | speedScroll.GetComponent<ClickScreenOtherSpace>().AddListener(() => |
| | | { |
| | | isOpenSpeedScroll = false; |
| | | speedArrow.transform.localRotation = Quaternion.Euler(0, 0, 0); |
| | | }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | costScroll.OnRefreshCell += OnRefreshCostCell; |
| | | speedScroll.OnRefreshCell += OnRefreshSpeedCell; |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | costScroll.OnRefreshCell -= OnRefreshCostCell; |
| | | speedScroll.OnRefreshCell -= OnRefreshSpeedCell; |
| | | } |
| | | |
| | | |
| | | void Display() |
| | | { |
| | | costText.text = AutoFightModel.Instance.fightCost.ToString(); |
| | | speedText.text = AutoFightModel.Instance.fightSpeed.ToString(); |
| | | betterEquipToggle.isOn = AutoFightModel.Instance.isStopFightByBetterEquip; |
| | | costTip.text = Language.Get("AutoFight2", ItemConfig.Get(GeneralDefine.MoneyDisplayModel[41]).ItemName, AutoFightModel.Instance.fightCost); |
| | | |
| | | if (AutoFightModel.Instance.isAutoAttackSet) |
| | | { |
| | | usingAutoObj.SetActive(true); |
| | | autoStartBtn.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | usingAutoObj.SetActive(false); |
| | | autoStartBtn.SetActive(true); |
| | | } |
| | | |
| | | costScroll.SetActive(false); |
| | | speedScroll.SetActive(false); |
| | | costArrow.transform.localRotation = Quaternion.Euler(0, 0, 0); |
| | | speedArrow.transform.localRotation = Quaternion.Euler(0, 0, 0); |
| | | |
| | | CreateCostScroll(); |
| | | CreateSpeedScroll(); |
| | | |
| | | } |
| | | |
| | | |
| | | void CreateCostScroll() |
| | | { |
| | | costScroll.Refresh(); |
| | | for (int i = 0; i < AutoFightModel.Instance.maxCost; i++) |
| | | { |
| | | costScroll.AddCell(ScrollerDataType.Header, i + 1); |
| | | } |
| | | costScroll.Restart(); |
| | | } |
| | | |
| | | void CreateSpeedScroll() |
| | | { |
| | | speedScroll.Refresh(); |
| | | for (int i = 0; i < AutoFightModel.Instance.maxSpeed; i++) |
| | | { |
| | | speedScroll.AddCell(ScrollerDataType.Header, i + 1); |
| | | } |
| | | speedScroll.Restart(); |
| | | } |
| | | |
| | | |
| | | void OnRefreshCostCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var btn = cell.GetComponent<Button>(); |
| | | |
| | | btn.AddListener(() => |
| | | { |
| | | if (AutoFightModel.Instance.autoCostWithBlessLV[cell.index - 1] > BlessLVManager.Instance.m_TreeLV) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("autofight4", AutoFightModel.Instance.autoCostWithBlessLV[cell.index - 1]); |
| | | return; |
| | | } |
| | | isOpenCostScroll = false; |
| | | costScroll.SetActive(false); |
| | | costArrow.transform.localRotation = Quaternion.Euler(0, 0, 0); |
| | | costText.text = cell.index.ToString(); |
| | | costTip.text = Language.Get("AutoFight2", ItemConfig.Get(GeneralDefine.MoneyDisplayModel[41]).ItemName, cell.index); |
| | | |
| | | }); |
| | | |
| | | |
| | | |
| | | var cntText = cell.GetComponentInChildren<Text>(); |
| | | |
| | | if (AutoFightModel.Instance.autoCostWithBlessLV[cell.index - 1] <= BlessLVManager.Instance.m_TreeLV) |
| | | { |
| | | cntText.text = UIHelper.AppendColor(TextColType.LightWhite, cell.index.ToString()); |
| | | } |
| | | else |
| | | { |
| | | cntText.text = UIHelper.AppendColor(TextColType.Gray, cell.index.ToString()); |
| | | } |
| | | } |
| | | |
| | | |
| | | void OnRefreshSpeedCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var btn = cell.GetComponent<Button>(); |
| | | var needtaskCount = TaskManager.Instance.GetNeedFinishTaskCount(AutoFightModel.Instance.speed2UnlockMissionID); |
| | | RechargeCount _rechargeCount; |
| | | bool isbuy = false; |
| | | if (RechargeManager.Instance.TryGetRechargeCount(AutoFightModel.Instance.speed3UnlockCTGID, out _rechargeCount)) |
| | | { |
| | | isbuy = _rechargeCount.totalCount > 0; |
| | | } |
| | | |
| | | |
| | | btn.AddListener(() => |
| | | { |
| | | if (cell.index == 2) |
| | | { |
| | | if (needtaskCount > 0) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("autofight2", needtaskCount); |
| | | return; |
| | | } |
| | | } |
| | | else if (cell.index == 3) |
| | | { |
| | | if (!isbuy) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("autofight3"); |
| | | return; |
| | | } |
| | | } |
| | | isOpenSpeedScroll = false; |
| | | speedScroll.SetActive(false); |
| | | speedArrow.transform.localRotation = Quaternion.Euler(0, 0, 0); |
| | | speedText.text = cell.index.ToString(); |
| | | }); |
| | | |
| | | var cntText = cell.GetComponentInChildren<Text>(); |
| | | if (cell.index == 2) |
| | | { |
| | | cntText.text = UIHelper.AppendColor(needtaskCount > 0 ? TextColType.Gray : TextColType.LightWhite, cell.index.ToString()); |
| | | } |
| | | else if (cell.index == 3) |
| | | { |
| | | cntText.text = UIHelper.AppendColor(isbuy ? TextColType.LightWhite : TextColType.Gray, cell.index.ToString()); |
| | | } |
| | | else |
| | | { |
| | | cntText.text = cell.index.ToString(); |
| | | } |
| | | } |
| | | |
| | | void OnClickAutoStart() |
| | | { |
| | | AutoFightModel.Instance.isAutoAttackSet = true; |
| | | AutoFightModel.Instance.fightCost = int.Parse(costText.text); |
| | | AutoFightModel.Instance.fightSpeed = int.Parse(speedText.text); |
| | | AutoFightModel.Instance.isStopFightByBetterEquip = betterEquipToggle.isOn; |
| | | AutoFightModel.Instance.SaveAutoFightSetting(); |
| | | CloseWindow(); |
| | | SysNotifyMgr.Instance.ShowTip("autofight1"); |
| | | } |
| | | |
| | | void OnClickAutoStop() |
| | | { |
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), |
| | | Language.Get("AutoFight11"), (bool isOK) => |
| | | { |
| | | if (isOK) |
| | | { |
| | | AutoFightModel.Instance.isAutoAttackSet = false; |
| | | AutoFightModel.Instance.fightCost = int.Parse(costText.text); |
| | | AutoFightModel.Instance.fightSpeed = int.Parse(speedText.text); |
| | | AutoFightModel.Instance.isStopFightByBetterEquip = betterEquipToggle.isOn; |
| | | AutoFightModel.Instance.SaveAutoFightSetting(); |
| | | CloseWindow(); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | } |
copy from Main/Component/UI/Common/FuncEnable.cs.meta
copy to Main/System/Main/AutoFightWin.cs.meta
File was copied from Main/Component/UI/Common/FuncEnable.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e034d1a3f772bb44bbbcd4273f5084e1 |
| | | timeCreated: 1516430103 |
| | | licenseType: Free |
| | | guid: eb3b2c8794aa61c4c95ea434c6baebbc |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | |
| | | /// <summary> |
| | | /// 选择标签 |
| | | /// </summary> |
| | | protected void SelectBottomTab(int index) |
| | | protected virtual void SelectBottomTab(int index) |
| | | { |
| | | // 如果点击当前已选中的标签,不做处理 |
| | | if (functionOrder == index && currentSubUI != null) |
| | |
| | | |
| | | [SerializeField] Button changeHeroPosBtn; |
| | | |
| | | [SerializeField] Button autoBtn; |
| | | //等级 |
| | | [SerializeField] Button officialUpBtn; |
| | | |
| | | |
| | | //底部功能 |
| | | [SerializeField] Button autoBtn; |
| | | [SerializeField] Image autoCloseImg; |
| | | [SerializeField] UIEffectPlayer autoOpenEffect; |
| | | [SerializeField] Button blessLVBtn; |
| | | [SerializeField] Text blessLVText; |
| | | |
| | | //其他功能入口 |
| | | [SerializeField] Button monthCardBtn; |
| | |
| | | |
| | | autoBtn.AddListener(() => |
| | | { |
| | | //测试拾取所有物品 |
| | | var items = PackManager.Instance.GetItems(PackType.DropItem); |
| | | List<int> dropindexs = new List<int>(); |
| | | for (int i = 0; i < items.Count; i++) |
| | | { |
| | | var item = items[i]; |
| | | if (dropindexs.Count > 5) |
| | | { |
| | | EquipModel.Instance.NotifyItemDrop(dropindexs, BattleManager.Instance.storyBattleField.battleRootNode.blueTeamNodeList[Random.Range(0, 5)].GetComponent<RectTransform>()); |
| | | dropindexs.Clear(); |
| | | } |
| | | // //测试拾取所有物品 |
| | | // var items = PackManager.Instance.GetItems(PackType.DropItem); |
| | | // List<int> dropindexs = new List<int>(); |
| | | // for (int i = 0; i < items.Count; i++) |
| | | // { |
| | | // var item = items[i]; |
| | | // if (dropindexs.Count > 5) |
| | | // { |
| | | // EquipModel.Instance.NotifyItemDrop(dropindexs, BattleManager.Instance.storyBattleField.battleRootNode.blueTeamNodeList[Random.Range(0, 5)].GetComponent<RectTransform>()); |
| | | // dropindexs.Clear(); |
| | | // } |
| | | |
| | | dropindexs.Add(item.gridIndex); |
| | | } |
| | | if (dropindexs.Count > 0) |
| | | // dropindexs.Add(item.gridIndex); |
| | | // } |
| | | // if (dropindexs.Count > 0) |
| | | // { |
| | | // EquipModel.Instance.NotifyItemDrop(dropindexs, BattleManager.Instance.storyBattleField.battleRootNode.blueTeamNodeList[Random.Range(0, 5)].GetComponent<RectTransform>()); |
| | | // dropindexs.Clear(); |
| | | // } |
| | | if (!FuncOpen.Instance.IsFuncOpen(108, true)) |
| | | { |
| | | EquipModel.Instance.NotifyItemDrop(dropindexs, BattleManager.Instance.storyBattleField.battleRootNode.blueTeamNodeList[Random.Range(0, 5)].GetComponent<RectTransform>()); |
| | | dropindexs.Clear(); |
| | | return; |
| | | } |
| | | UIManager.Instance.OpenWindow<AutoFightWin>(); |
| | | }); |
| | | |
| | | |
| | |
| | | { |
| | | InvestModel.Instance.BuyInvest(InvestModel.monthCardType); |
| | | }); |
| | | |
| | | blessLVBtn.AddListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<BlessLVWin>(); |
| | | }); |
| | | |
| | | officialUpBtn.AddListener(()=> |
| | | { |
| | | if (RealmConfig.GetKeys().Count <= PlayerDatas.Instance.baseData.realmLevel) |
| | | return; |
| | | UIManager.Instance.OpenWindow<OfficialUpWin>(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public override void Refresh() |
| | | public void Display() |
| | | { |
| | | UpdatePlayerInfo(); |
| | | UpdateTask(); |
| | | RefreshRecharge(); |
| | | ShowBlessLV(); |
| | | DisplayAutoFight(); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh; |
| | | TaskManager.Instance.OnTaskUpdate += UpdateTask; |
| | | Refresh(); |
| | | BlessLVManager.Instance.OnBlessLVUpdateEvent += ShowBlessLV; |
| | | AutoFightModel.Instance.ChangeAutoEvent += DisplayAutoFight; |
| | | Display(); |
| | | // var battleWin = UIManager.Instance.OpenWindow<BattleWin>(); |
| | | // battleWin.SetBattleField(BattleManager.Instance.storyBattleField); |
| | | } |
| | | protected override void OnOpen() |
| | | { |
| | | base.OnOpen(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh; |
| | | TaskManager.Instance.OnTaskUpdate -= UpdateTask; |
| | | BlessLVManager.Instance.OnBlessLVUpdateEvent -= ShowBlessLV; |
| | | AutoFightModel.Instance.ChangeAutoEvent -= DisplayAutoFight; |
| | | |
| | | // 关闭的时候把战斗界面也给关了 虽然是在外面开的 |
| | | UIManager.Instance.CloseWindow<BattleWin>(); |
| | |
| | | monthCardBtn.SetActive(!InvestModel.Instance.IsInvested(InvestModel.monthCardType)); |
| | | } |
| | | |
| | | |
| | | void ShowBlessLV() |
| | | { |
| | | blessLVText.text = BlessLVManager.Instance.m_TreeLV.ToString(); |
| | | } |
| | | |
| | | void DisplayAutoFight() |
| | | { |
| | | if (AutoFightModel.Instance.isAutoAttackSet) |
| | | { |
| | | autoCloseImg.SetActive(false); |
| | | autoOpenEffect.Play(); |
| | | } |
| | | else |
| | | { |
| | | autoCloseImg.SetActive(true); |
| | | autoOpenEffect.Stop(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新玩家信息 |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public class MainWin : FunctionsBaseWin |
| | | { |
| | | //头像区 |
| | | //头像区 |
| | | [SerializeField] GameObject topBar; |
| | | [SerializeField] AvatarCell avatarCell; |
| | | [SerializeField] Text playerNameText; |
| | | [SerializeField] Text powerText; |
| | |
| | | } |
| | | |
| | | |
| | | protected override void SelectBottomTab(int index) |
| | | { |
| | | if (index == 3) |
| | | { |
| | | //挑战特殊显示逻辑 |
| | | return; |
| | | } |
| | | |
| | | topBar.SetActive(index == 0 || index == 2); |
| | | // 如果点击当前已选中的标签,不做处理 |
| | | if (functionOrder == index && currentSubUI != null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | // 更新当前选中的标签索引 |
| | | functionOrder = index; |
| | | |
| | | // 关闭当前打开的子界面 |
| | | CloseCurrentSubUI(); |
| | | |
| | | // 根据选中的标签打开对应的界面 |
| | | OpenSubUIByTabIndex(); |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 更新玩家信息 |
| | | /// </summary> |
| | |
| | | PlayerDatas.Instance.baseData.facePic)); |
| | | |
| | | playerNameText.text = PlayerDatas.Instance.baseData.PlayerName; |
| | | powerText.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPoint); |
| | | powerText.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPower); |
| | | |
| | | officialRankText.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID); |
| | | } |
| | |
| | | switch (type) |
| | | { |
| | | case PlayerDataType.FightPower: |
| | | powerText.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPoint); |
| | | powerText.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPower); |
| | | break; |
| | | case PlayerDataType.RealmLevel: |
| | | officialRankText.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID); |
| | |
| | | { |
| | | if (currentSubUI != null && currentSubUI.name == "HomeWin") |
| | | { |
| | | Debug.Log("点击主界面按钮"); |
| | | //打开主界面的情况下再点击按钮,执行攻击逻辑 |
| | | if (AutoFightModel.Instance.isAutoAttackSet) |
| | | { |
| | | AutoFightModel.Instance.isAutoAttack = true; |
| | | } |
| | | StoryBattleField storyBattleField = BattleManager.Instance.storyBattleField; |
| | | if (storyBattleField != null) |
| | | { |
| | |
| | | Debug.Log("打开主城界面"); |
| | | break; |
| | | case 1: |
| | | currentSubUI = UIManager.Instance.OpenWindow<RolePackWin>(); |
| | | currentSubUI = UIManager.Instance.OpenWindow<AffairBaseWin>(); |
| | | Debug.Log("打开内政界面"); |
| | | break; |
| | | case 2: |
| | | currentSubUI = UIManager.Instance.OpenWindow<HeroBaseWin>(0); |
| | | Debug.Log("打开武将界面"); |
| | | break; |
| | | case 3: |
| | | // currentSubUI = UIManager.Instance.OpenUI<QuestUI>(); |
| | | Debug.Log("打开挑战界面"); |
| | | break; |
| | | // case 3: |
| | | // // currentSubUI = UIManager.Instance.OpenUI<QuestUI>(); |
| | | // Debug.Log("打开挑战界面"); |
| | | // break; |
| | | case 4: |
| | | //currentSubUI = UIManager.Instance.OpenWindow<PlaceWin>(); |
| | | Debug.Log("打开公会界面"); |
| | | currentSubUI = UIManager.Instance.OpenWindow<GuildBaseWin>(); |
| | | break; |
| | | default: |
| | | Debug.LogWarning("未知的标签索引: " + functionOrder); |
| | |
| | | //挂父节点
|
| | | imgMoney.transform.SetParentEx(this.transform, Vector3.zero, Quaternion.identity, Vector3.one);
|
| | | var moneyImg = imgMoney.GetComponent<ImageEx>();
|
| | | moneyImg.SetSprite(StringUtility.Contact("Money_Type_", moneyType));
|
| | | moneyImg.SetIconWithMoneyType(moneyType);
|
| | | moneyImg.raycastTarget = false;
|
| | | moneyImg.GetComponent<RectTransform>().sizeDelta = new Vector2(40, 40);
|
| | | imgMoneys.Add(moneyImg);
|
| | |
| | | presentImgInfo.spriteName = array[1]; |
| | | } |
| | | break; |
| | | case "folder": |
| | | { |
| | | presentImgInfo.folderName = array[1]; |
| | | } |
| | | break; |
| | | case "face": |
| | | { |
| | | presentImgInfo.spriteName = array[1]; |
| | |
| | | height = (int)RichTextMgr.Inst.presentRichText.FaceSize; |
| | | } |
| | | else |
| | | { |
| | | { |
| | | if (UIFrameMgr.Inst.ContainsDynamicImage(presentImgInfo.spriteName)) |
| | | { |
| | | var list = UIFrameMgr.Inst.GetDynamicImage(presentImgInfo.spriteName); |
| | |
| | | if (presentImgInfo.IsFace) return; |
| | | if (IconConfig.isInit) |
| | | { |
| | | presentImgInfo.sprite = UILoader.LoadSprite(presentImgInfo.spriteName); |
| | | if (!string.IsNullOrEmpty(presentImgInfo.folderName)) |
| | | { |
| | | presentImgInfo.sprite = UILoader.LoadSprite(presentImgInfo.folderName, presentImgInfo.spriteName); |
| | | } |
| | | else |
| | | { |
| | | presentImgInfo.sprite = UILoader.LoadSprite(presentImgInfo.spriteName); |
| | | } |
| | | } |
| | | |
| | | if (presentImgInfo.sprite != null) |
| | |
| | | // { |
| | | // colorType = RichTextMgr.Inst.presentRichText.colorType == RichText.ColorType.Dark ? 0 : 1; |
| | | // } |
| | | // var fightPoint = PlayerDatas.Instance.baseData.FightPoint; |
| | | // var fightPoint = PlayerDatas.Instance.baseData.FightPower; |
| | | // ulong targetValue = 0; |
| | | // var infoArray = dic["myfightpoint"].Split('_'); |
| | | // if (infoArray.Length > 1) |
| | |
| | | |
| | | public Sprite sprite; |
| | | public string spriteName; |
| | | public string folderName; //没有在icon表中配置的,直接配置图片名,需配置文件夹路径 |
| | | public bool IsFace; |
| | | public float scale; //缩放图片的同时,二次缩放了图片在文本钟的占位大小,查看函数InverseToRichText |
| | | |
| | |
| | | // BattleHint.Instance.OnStageLoadFinish(); |
| | | } |
| | | |
| | | private void BeforePlayerDataInitializeEvent() |
| | | public void BeforePlayerDataInitializeEvent() |
| | | { |
| | | ScrollTip.m_Hints.Clear(); |
| | | ServerTipDetails.ClearHint(); |
| | |
| | | } |
| | | } |
| | | |
| | | //信息提示表的提示 |
| | | public void ShowTip(string key, params object[] msg) |
| | | { |
| | | SysInfoConfig cfg = SysInfoConfig.Get(key); |
| | |
| | | AnalysisSysmsg(cfg); |
| | | } |
| | | else |
| | | { |
| | | { |
| | | Debug.LogError("未找到系统提示信息: " + key); |
| | | } |
| | | } |
| | | |
| | | //语言表的提示 |
| | | public void ShowLangTip(string key, params object[] msg) |
| | | { |
| | | string hint = Language.Get(key, msg); |
| | | ScrollTip.ShowTip(hint); |
| | | } |
| | | |
| | | //直接传文字的提示 |
| | | public void ShowStringTip(string hint) |
| | | { |
| | | ScrollTip.ShowTip(hint); |
| | | } |
| | | |
| | | void AnalysisSysmsg(SysInfoConfig cfg) |
| | | { |
| | | SysNotifySound(cfg.sound); |
New file |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 官职升级界面 |
| | | /// </summary> |
| | | public class OfficialLVUPSuccessWin : UIBase |
| | | { |
| | | |
| | | [SerializeField] Text beforeNameText; |
| | | [SerializeField] Text nameText; |
| | | [SerializeField] Text lvText; |
| | | [SerializeField] Text nextLVText; |
| | | [SerializeField] Text[] attrNameText; |
| | | [SerializeField] Text[] attrPerTextArr; |
| | | [SerializeField] Text[] nextAttrPerTextArr; |
| | | [SerializeField] Button okBtn; |
| | | |
| | | |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | okBtn.AddListener(CloseWindow); |
| | | } |
| | | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | |
| | | Refresh(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | } |
| | | |
| | | |
| | | public override void Refresh() |
| | | { |
| | | var beforeConfig = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel - 1); |
| | | var config = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel); |
| | | beforeNameText.text = beforeConfig.Name; |
| | | beforeNameText.color = OfficialRankManager.Instance.GetOfficialRankColor(beforeConfig.Quality); |
| | | nameText.text = config.Name; |
| | | nameText.color = OfficialRankManager.Instance.GetOfficialRankColor(config.Quality); |
| | | lvText.text = beforeConfig.LVMax.ToString(); |
| | | nextLVText.text = config.LVMax.ToString(); |
| | | |
| | | for (int i = 0; i < attrNameText.Length; i++) |
| | | { |
| | | attrNameText[i].text = PlayerPropertyConfig.Get(config.AddAttrType[i]).Name; |
| | | attrPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(config.AddAttrType[i], beforeConfig.AddAttrType[i]); |
| | | nextAttrPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(config.AddAttrType[i], config.AddAttrType[i]); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |
copy from Main/Component/UI/Common/FuncEnable.cs.meta
copy to Main/System/OfficialRank/OfficialLVUPSuccessWin.cs.meta
File was copied from Main/Component/UI/Common/FuncEnable.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e034d1a3f772bb44bbbcd4273f5084e1 |
| | | timeCreated: 1516430103 |
| | | licenseType: Free |
| | | guid: e631511e7fa941d44911d5d592beb0ad |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | |
| | |
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using UnityEngine;
|
| | |
|
| | | public class OfficialRankManager : GameSystemManager<OfficialRankManager>
|
| | | {
|
| | | bool redpointDirty = false;
|
| | |
|
| | | #region 官职任务
|
| | | //当前官职的任务状态
|
| | | int taskAwardState;
|
| | | Dictionary<int, int> taskValues = new Dictionary<int, int>();
|
| | | public Dictionary<int, int[]> realMissionGuides = new Dictionary<int, int[]>();
|
| | | public event Action RealmMissionRefreshEvent;
|
| | |
|
| | | public Dictionary<int, int> mainLevelDict = new Dictionary<int, int>(); //id:索引 用于判断还需多少关
|
| | | public override void Init()
|
| | | {
|
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh;
|
| | | BlessLVManager.Instance.OnBlessLVUpdateEvent += UpdateRedpoint;
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitialize;
|
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += UpdateRedpoint;
|
| | |
|
| | |
|
| | | var levelList = MainLevelConfig.GetKeys().ToList();
|
| | | levelList.Sort();
|
| | | for (int i = 0; i < levelList.Count; i++)
|
| | | { |
| | | mainLevelDict[levelList[i]] = i;
|
| | | }
|
| | | }
|
| | |
|
| | | public override void Release()
|
| | | {
|
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh;
|
| | | BlessLVManager.Instance.OnBlessLVUpdateEvent -= UpdateRedpoint;
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= BeforePlayerDataInitialize;
|
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= UpdateRedpoint;
|
| | | }
|
| | |
|
| | | void BeforePlayerDataInitialize()
|
| | | {
|
| | | taskValues.Clear();
|
| | | taskAwardState = 0;
|
| | | }
|
| | |
|
| | |
|
| | | void PlayerDataRefresh(PlayerDataType type)
|
| | | {
|
| | | if (type == PlayerDataType.LV ||
|
| | | type == PlayerDataType.ExAttr1
|
| | | )
|
| | | {
|
| | | //等级 通关
|
| | | UpdateRedpoint();
|
| | | }
|
| | | else if (type == PlayerDataType.RealmLevel)
|
| | | {
|
| | | if (!DTC0403_tagPlayerLoginLoadOK.finishedLogin)
|
| | | return;
|
| | | //升级成功表现
|
| | | if (!UIManager.Instance.IsOpened<OfficialLVUPSuccessWin>())
|
| | | {
|
| | | UIManager.Instance.OpenWindow<OfficialLVUPSuccessWin>();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | // 返回服务端的记录任务奖励状态 0未领取 1已领取
|
| | | public int GetMissionAwardState(int id)
|
| | |
| | | return (taskAwardState & (int)Math.Pow(2, id)) != 0 ? 1 : 0;
|
| | | }
|
| | |
|
| | | //任务类型 任务说明 所需值
|
| | | // 1 等级达到x级 x级
|
| | | // 2 通关x地图x层 地图ID|层 |
| | | // 3 消耗战锤 x个
|
| | |
|
| | | // 2 通过主线关卡 关卡ID |
| | | // 3 消耗战锤 x个 (仅通知这个)
|
| | | // 4 祝福树 等级 |
| | | //客户端显示的任务状态 0 代表进行中 1 代表可领取 2 代表已领取
|
| | | public int GetMissionState(int realm, int missionID)
|
| | | {
|
| | | var id = RealmLVUPTaskConfig.GetID(realm, missionID);
|
| | | var config = RealmLVUPTaskConfig.Get(id);
|
| | | var config = RealmLVUPTaskConfig.GetID(realm, missionID);
|
| | | var type = config.TaskType;
|
| | |
|
| | | if (GetMissionAwardState(missionID) == 1)
|
| | |
| | | case 1:
|
| | | return PlayerDatas.Instance.baseData.LV >= config.NeedValueList[0] ? 1 : 0;
|
| | | case 2:
|
| | | if (config.NeedValueList[0] == 0)
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | return 0;
|
| | | //策划配置关卡ID为201,即 过关2-1(0/1) ,使用 ExAttr1 值判断,如ExAttr1值为20103代表当前已经过了第2章第1关第3波,包含了波,需要击败该关卡boss后才算该关过关
|
| | | return PlayerDatas.Instance.baseData.ExAttr1 / 100 > config.NeedValueList[0] ? 1 : 0;
|
| | | case 3:
|
| | | return taskValues.ContainsKey(missionID) && taskValues[missionID] >= config.NeedValueList[0] ? 1 : 0;
|
| | | |
| | | |
| | | case 4:
|
| | | return BlessLVManager.Instance.m_TreeLV >= config.NeedValueList[0] ? 1 : 0;
|
| | |
|
| | | default:
|
| | | return 0;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public int GetMissionProcess(int id)
|
| | | public void GetMissionProcess(int id, out int process, out int total)
|
| | | {
|
| | | if (taskValues.ContainsKey(id))
|
| | | var config = RealmLVUPTaskConfig.GetID(PlayerDatas.Instance.baseData.realmLevel, id);
|
| | | var type = config.TaskType;
|
| | | process = 1;
|
| | | total = 1;
|
| | | switch (type)
|
| | | {
|
| | | return taskValues[id];
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | //type: 1等级 2通关 3消耗战锤
|
| | |
|
| | | public void RealMissionGuide(int type, int id = 0)
|
| | | {
|
| | | if (realMissionGuides.ContainsKey(type))
|
| | | {
|
| | | |
| | | int guideIndex = 0;
|
| | | if (type == 1)
|
| | | {
|
| | | |
| | | }
|
| | | else if (type == 2)
|
| | | {
|
| | | if (!FuncOpen.Instance.IsFuncOpen(164, true))
|
| | | {
|
| | | return;
|
| | | }
|
| | | }
|
| | | else if (type == 3)
|
| | | {
|
| | | if (FuncOpen.Instance.IsFuncOpen(108))
|
| | | {
|
| | | guideIndex = 1;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | //NewBieCenter.Instance.StartNewBieGuideEx(guideID);
|
| | | case 1:
|
| | | process = PlayerDatas.Instance.baseData.LV;
|
| | | total = config.NeedValueList[0];
|
| | | break;
|
| | | case 2:
|
| | | process = PlayerDatas.Instance.baseData.ExAttr1 / 100 > config.NeedValueList[0] ? 1 : 0;
|
| | | total = 1;
|
| | | break;
|
| | | case 3:
|
| | | process = taskValues.ContainsKey(id) ? taskValues[id] : 0;
|
| | | total = config.NeedValueList[0];
|
| | | break;
|
| | | case 4:
|
| | | process = BlessLVManager.Instance.m_TreeLV;
|
| | | total = config.NeedValueList[0];
|
| | | break;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | public void RequestAllAwards()
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | RealmMissionRefreshEvent?.Invoke();
|
| | | redpointDirty = true;
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | Redpoint redpoint = new Redpoint(MainRedDot.RedPoint_OfficialKey);
|
| | | void UpdateRedpoint()
|
| | | {
|
| | | redpoint.state = RedPointState.None;
|
| | |
|
| | | var ids = RealmLVUPTaskConfig.GetMissionIDs(PlayerDatas.Instance.baseData.realmLevel);
|
| | | bool finish = true;
|
| | | foreach (var id in ids)
|
| | | {
|
| | | if (GetMissionAwardState(id) != 1)
|
| | | {
|
| | | if (GetMissionState(PlayerDatas.Instance.baseData.realmLevel, id) == 1)
|
| | | {
|
| | | redpoint.state = RedPointState.Simple;
|
| | | }
|
| | |
|
| | | finish = false;
|
| | | }
|
| | | }
|
| | | |
| | | if (finish)
|
| | | redpoint.state = RedPointState.Simple;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | public Color GetOfficialRankColor(int quality)
|
| | | {
|
| | |
|
| | | switch (quality)
|
| | | {
|
| | | case 1:
|
| | | // bbbbbb
|
| | | return new Color32(187, 187, 187, 255);
|
| | | case 2:
|
| | | // ffffff
|
| | | return new Color32(255, 255, 255, 255);
|
| | | case 3:
|
| | | // bbd5ff
|
| | | return new Color32(187, 213, 255, 255);
|
| | | case 4:
|
| | | // e4bbfe
|
| | | return new Color32(228, 187, 254, 255);
|
| | | case 5:
|
| | | // f7eba4
|
| | | return new Color32(247, 235, 164, 255);
|
| | | case 6:
|
| | | // ffc096
|
| | | return new Color32(255, 192, 150, 255);
|
| | | case 7:
|
| | | // fe9896
|
| | | return new Color32(254, 152, 150, 255);
|
| | | case 8:
|
| | | // ffaffe
|
| | | return new Color32(255, 174, 254, 255);
|
| | | case 9:
|
| | | // ffefcl
|
| | | return new Color32(255, 239, 203, 255);
|
| | | case 10:
|
| | | // e9fffa
|
| | | return new Color32(233, 255, 250, 255);
|
| | | case 11:
|
| | | // f5ddff
|
| | | return new Color32(245, 221, 255, 255);
|
| | | case 12:
|
| | | // b3fcfe
|
| | | return new Color32(179, 252, 254, 255);
|
| | | case 13:
|
| | | // ffd0f7
|
| | | return new Color32(255, 208, 247, 255);
|
| | | }
|
| | | return Color.white;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | /// <summary> |
| | | /// 官职任务 |
| | | /// </summary> |
| | | public class OfficialUpCell : MonoBehaviour |
| | | { |
| | | |
| | | [SerializeField] Text stateName; |
| | | [SerializeField] Image stateImg; |
| | | [SerializeField] Image bgImg; |
| | | [SerializeField] Image finishImg; |
| | | [SerializeField] Image getAwardImg; |
| | | [SerializeField] Text taskName; |
| | | [SerializeField] Image taskProcess; |
| | | [SerializeField] Text taskProcessText; |
| | | [SerializeField] ItemCell taskReward; |
| | | [SerializeField] Button getBtn; |
| | | |
| | | |
| | | public void Display(int id) |
| | | { |
| | | var config = RealmLVUPTaskConfig.GetID(PlayerDatas.Instance.baseData.realmLevel, id); |
| | | var state = OfficialRankManager.Instance.GetMissionState(PlayerDatas.Instance.baseData.realmLevel, id); |
| | | stateName.text = Language.Get("L1129_" + state); |
| | | stateImg.SetSprite("OfficialMisionState" + state); |
| | | finishImg.SetActive(state == 2); |
| | | getAwardImg.SetActive(state == 1); |
| | | bgImg.SetSprite(state == 0 ? "OfficialMissionBG0" : "OfficialMissionBG1"); |
| | | switch (config.TaskType) |
| | | { |
| | | case 1: |
| | | case 3: |
| | | case 4: |
| | | taskName.text = Language.Get("OfficialMission" + config.TaskType, config.NeedValueList[0]); |
| | | break; |
| | | case 2: |
| | | var mainLVConfig = MainLevelConfig.Get(config.NeedValueList[0]); |
| | | taskName.text = Language.Get("OfficialMission2", mainLVConfig.ChapterID, mainLVConfig.LevelNum); |
| | | break; |
| | | } |
| | | int process; |
| | | int total; |
| | | OfficialRankManager.Instance.GetMissionProcess(id, out process, out total); |
| | | taskProcess.fillAmount = (float)process / total; |
| | | taskProcessText.text = process + "/" + total; |
| | | int itemID = config.AwardItemList[0][0]; |
| | | taskReward.Init(new ItemCellModel(itemID, false, config.AwardItemList[0][1])); |
| | | taskReward.button.AddListener(() => |
| | | { |
| | | ItemTipUtility.Show(itemID); |
| | | }); |
| | | |
| | | getBtn.AddListener(() => |
| | | { |
| | | if (state != 1) |
| | | return; |
| | | OfficialRankManager.Instance.RequestAllAwards(); |
| | | }); |
| | | |
| | | } |
| | | |
| | | } |
copy from Main/Component/UI/Common/FuncEnable.cs.meta
copy to Main/System/OfficialRank/OfficialUpCell.cs.meta
File was copied from Main/Component/UI/Common/FuncEnable.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e034d1a3f772bb44bbbcd4273f5084e1 |
| | | timeCreated: 1516430103 |
| | | licenseType: Free |
| | | guid: e58cf79fdccd0d54093f13a7cbf9868d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using DG.Tweening; |
| | | using System; |
| | | |
| | | /// <summary> |
| | | /// 官职 |
| | | /// </summary> |
| | | public class OfficialUpWin : UIBase |
| | | { |
| | | [SerializeField] Text officialNameText; |
| | | [SerializeField] Text officialNextNameText; |
| | | [SerializeField] Image officialIcon; |
| | | [SerializeField] Image officialNextIcon; |
| | | [SerializeField] Button closeBtn; |
| | | [SerializeField] PositionTween[] paopaoArr; |
| | | [SerializeField] Text[] paopaoTextArrName; |
| | | [SerializeField] Text[] paopaoTextArrValue; |
| | | [SerializeField] OfficialUpCell[] missionCellArr; |
| | | [SerializeField] ButtonEx lvUpBtn; |
| | | [SerializeField] UIEffectPlayer effectPlayer; |
| | | [SerializeField] UIEffectPlayer upEffect; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | closeBtn.AddListener(CloseWindow); |
| | | lvUpBtn.AddListener(OnLvUp); |
| | | } |
| | | |
| | | // 1 等级达到x级 x级 |
| | | // 2 通过主线关卡 关卡ID |
| | | // 3 消耗战锤 x个 |
| | | // 4 祝福树 等级 |
| | | protected override void OnPreOpen() |
| | | { |
| | | OfficialRankManager.Instance.RealmMissionRefreshEvent += Refresh; |
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh; |
| | | BlessLVManager.Instance.OnBlessLVUpdateEvent += RefreshBtn; |
| | | Refresh(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | OfficialRankManager.Instance.RealmMissionRefreshEvent -= Refresh; |
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh; |
| | | BlessLVManager.Instance.OnBlessLVUpdateEvent -= RefreshBtn; |
| | | } |
| | | |
| | | public override void Refresh() |
| | | { |
| | | var config = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel); |
| | | officialNameText.text = config.Name; |
| | | officialNameText.color = OfficialRankManager.Instance.GetOfficialRankColor(config.Quality); |
| | | officialIcon.SetSprite("OfficialRank" + PlayerDatas.Instance.baseData.realmLevel); |
| | | var nextConfig = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel + 1); |
| | | officialNextNameText.text = nextConfig.Name; |
| | | officialNextNameText.color = OfficialRankManager.Instance.GetOfficialRankColor(nextConfig.Quality); |
| | | officialNextIcon.SetSprite("OfficialRank" + (PlayerDatas.Instance.baseData.realmLevel + 1)); |
| | | for (int i = 0; i < paopaoArr.Length; i++) |
| | | { |
| | | paopaoArr[i].Play(); |
| | | paopaoTextArrName[i].text = PlayerPropertyConfig.Get(nextConfig.AddAttrType[i]).Name; |
| | | paopaoTextArrValue[i].text = "+" + PlayerPropertyConfig.GetValueDescription(nextConfig.AddAttrType[i], nextConfig.AddAttrNum[i]); |
| | | } |
| | | |
| | | RefreshBtn(); |
| | | } |
| | | |
| | | |
| | | void OnLvUp() |
| | | { |
| | | var ids = RealmLVUPTaskConfig.GetMissionIDs(PlayerDatas.Instance.baseData.realmLevel); |
| | | foreach (var id in ids) |
| | | { |
| | | if (OfficialRankManager.Instance.GetMissionAwardState(id) != 1) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("OfficialTask1"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | //所有泡泡飞向按钮 |
| | | for (int i = 0; i < paopaoArr.Length; i++) |
| | | { |
| | | paopaoArr[i].Stop(); |
| | | paopaoArr[i].transform.DOLocalMove(lvUpBtn.transform.localPosition, 0.4f); |
| | | } |
| | | effectPlayer.Play(); |
| | | |
| | | upEffect.onComplete = () => |
| | | { |
| | | CA523_tagCMRealmLVUp pak = new CA523_tagCMRealmLVUp(); |
| | | GameNetSystem.Instance.SendInfo(pak); |
| | | }; |
| | | upEffect.Play(); |
| | | } |
| | | |
| | | |
| | | void RefreshBtn() |
| | | { |
| | | var ids = RealmLVUPTaskConfig.GetMissionIDs(PlayerDatas.Instance.baseData.realmLevel); |
| | | for (int i = 0; i < missionCellArr.Length; i++) |
| | | { |
| | | missionCellArr[i].Display(ids[i]); |
| | | } |
| | | |
| | | for (int i = 0; i < missionCellArr.Length; i++) |
| | | { |
| | | if (OfficialRankManager.Instance.GetMissionAwardState(i + 1) != 1) |
| | | { |
| | | lvUpBtn.SetColorful(null, false); |
| | | return; |
| | | } |
| | | } |
| | | lvUpBtn.SetColorful(null, true); |
| | | } |
| | | |
| | | |
| | | void PlayerDataRefresh(PlayerDataType type) |
| | | { |
| | | if (type == PlayerDataType.RealmLevel) |
| | | { |
| | | Refresh(); |
| | | } |
| | | else if (type == PlayerDataType.LV || |
| | | type == PlayerDataType.ExAttr1 |
| | | ) |
| | | { |
| | | //等级 通关 |
| | | RefreshBtn(); |
| | | } |
| | | } |
| | | } |
copy from Main/Component/UI/Common/FuncEnable.cs.meta
copy to Main/System/OfficialRank/OfficialUpWin.cs.meta
File was copied from Main/Component/UI/Common/FuncEnable.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e034d1a3f772bb44bbbcd4273f5084e1 |
| | | timeCreated: 1516430103 |
| | | licenseType: Free |
| | | guid: 3c74d5be428f2324e910c232fb4e414b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Wednesday, May 09, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | |
| | | }
|
| | |
|
| | |
|
| | | public struct RechargeCount
|
| | | {
|
| | | public int todayCount;
|
| | | public int totalCount;
|
| | | public int weekPayCount;
|
| | | public int monthPayCount;
|
| | | public int selectItemValue;
|
| | |
|
| | | }
|
| | |
|
| | | public int FirstGoldServerDay = 0; //0表示未充值,首充时为开服第几天(openday+1)
|
| | |
|
| | |
| | | }
|
| | |
|
| | |
|
| | | public struct RechargeCount
|
| | | {
|
| | | public int todayCount;
|
| | | public int totalCount;
|
| | | public int weekPayCount;
|
| | | public int monthPayCount;
|
| | | public int selectItemValue;
|
| | |
|
| | | }
|
| | |
| | | public Redpoint redPointBagFunc = new Redpoint(RedPoint_MainPackKey, RedPoint_BagFuncKey);
|
| | | #endregion
|
| | |
|
| | |
|
| | | //官职
|
| | | public const int RedPoint_OfficialKey = 101;
|
| | |
|
| | |
|
| | | #region 仙盟公用红点
|
| | |
| | | #region 仙盟活动红点
|
| | | public readonly Redpoint fairyActivityRedpoint = new Redpoint(218);
|
| | | #endregion
|
| | |
|
| | | |
| | | public static int BlessLVRedpoint = 399; //祝福等级红点
|
| | | public static int DailySpecialsRedpoint = 439; //每日特惠入口红点
|
| | |
|
| | | public static int BlessedLandRedpoint = 444; //福地红点
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 629835bc583036c41a4e9cb04fc4fdb7 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using System.Text; |
| | | using System; |
| | | using System.Text.RegularExpressions; |
| | | /// <summary> |
| | | /// 服务端Setting配置,存储一些快捷设置,目前长度为100 |
| | | /// </summary> |
| | | |
| | | public class QuickSetting : Singleton<QuickSetting> |
| | | { |
| | | public QuickSetting() |
| | | { |
| | | //自动战斗 几倍消耗 几倍速度 是否高战力停止 是否开启自动战斗 |
| | | quickSettingDic.Add(QuickSettingType.AutoFight_Cost, new QuickSettingRange(QuickSettingType.AutoFight_Cost, 0, 1)); |
| | | quickSettingDic.Add(QuickSettingType.AutoFight_Speed, new QuickSettingRange(QuickSettingType.AutoFight_Speed, 1, 1)); |
| | | quickSettingDic.Add(QuickSettingType.AutoFight_FightPower, new QuickSettingRange(QuickSettingType.AutoFight_FightPower, 2, 1)); |
| | | quickSettingDic.Add(QuickSettingType.AutoFight_Open, new QuickSettingRange(QuickSettingType.AutoFight_Open, 3, 1)); |
| | | setting = new string(UCharacter, 100); |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent; |
| | | } |
| | | |
| | | public Dictionary<QuickSettingType, QuickSettingRange> quickSettingDic = new Dictionary<QuickSettingType, QuickSettingRange>(); |
| | | public const char UCharacter = '*'; |
| | | private string setting; |
| | | private string cacheSetting; |
| | | private StringBuilder textBuilder = new StringBuilder(); |
| | | |
| | | public event Action onQuickSettingUpdate; |
| | | |
| | | public void SetQuickSetting<T>(QuickSettingType type, T value, int index = 0) where T : struct |
| | | { |
| | | SetQuickSetting(type, value.ToString(), index); |
| | | } |
| | | public void SetQuickSetting(QuickSettingType type, bool value, int index = 0) |
| | | { |
| | | SetQuickSetting<int>(type, value ? 1 : 0, index); |
| | | } |
| | | |
| | | public void SetQuickSetting(int type, string value, int index) |
| | | { |
| | | SetQuickSetting((QuickSettingType)type, value, index); |
| | | } |
| | | |
| | | public void SetQuickSetting(QuickSettingType type, string value, int index) |
| | | { |
| | | var quickRange = quickSettingDic[type]; |
| | | |
| | | |
| | | if ((index - quickRange.index) * quickRange.single + value.Length > quickRange.length || value.Length > quickRange.single) |
| | | { |
| | | Debug.LogErrorFormat("存储的数据超过最大长度!{0}", type); |
| | | return; |
| | | } |
| | | textBuilder.Length = 0; |
| | | var start = quickRange.index + index * quickRange.single; |
| | | var end = start + value.Length; |
| | | if (quickRange.length == quickRange.single) |
| | | { |
| | | end = start + quickRange.length; |
| | | } |
| | | textBuilder.Append(setting, 0, start); |
| | | textBuilder.Append(value); |
| | | if (quickRange.length == quickRange.single |
| | | && quickRange.length > value.Length) |
| | | { |
| | | textBuilder.Append('*', quickRange.length - value.Length); |
| | | } |
| | | textBuilder.Append(setting, end, setting.Length - end); |
| | | setting = textBuilder.ToString(); |
| | | PlayerDatas.Instance.baseData.Setting = setting; |
| | | } |
| | | public void SetQuickSetting(string value) |
| | | { |
| | | value = UIHelper.ServerStringTrim(value); |
| | | if (value != null && value.Length > 0) |
| | | { |
| | | setting = StringUtility.Contact(value, setting.Substring(value.Length, setting.Length - value.Length)); |
| | | cacheSetting = setting; |
| | | PlayerDatas.Instance.baseData.Setting = setting; |
| | | } |
| | | |
| | | if (onQuickSettingUpdate != null) |
| | | { |
| | | onQuickSettingUpdate(); |
| | | } |
| | | } |
| | | |
| | | public T GetQuickSettingValue<T>(QuickSettingType type, int index) where T : struct |
| | | { |
| | | string destinationStr = GetQuickSetting(type, index); |
| | | if (string.IsNullOrEmpty(destinationStr)) |
| | | { |
| | | return default(T); |
| | | } |
| | | return (T)Convert.ChangeType(destinationStr, typeof(T)); |
| | | } |
| | | public string GetQuickSetting(QuickSettingType type, int index) |
| | | { |
| | | var quickRange = quickSettingDic[type]; |
| | | var start = quickRange.index + index * quickRange.single; |
| | | var destinationStr = setting.Substring(start, quickRange.single); |
| | | destinationStr = Regex.Replace(destinationStr, @"\*", string.Empty); |
| | | return destinationStr; |
| | | } |
| | | public bool GetQuickSettingBool(QuickSettingType type, int index, bool _default = false) |
| | | { |
| | | string destinationStr = GetQuickSetting(type, index); |
| | | if (string.IsNullOrEmpty(destinationStr)) |
| | | { |
| | | return _default; |
| | | } |
| | | int _value = _default ? 1 : 0; |
| | | int.TryParse(destinationStr, out _value); |
| | | return _value == 1; |
| | | } |
| | | |
| | | public string GetQuickSetting(int type, int index) |
| | | { |
| | | return GetQuickSetting((QuickSettingType)type, index); |
| | | } |
| | | |
| | | public void SendPackage() |
| | | { |
| | | if (cacheSetting != setting) |
| | | { |
| | | cacheSetting = setting; |
| | | C0303_tagCSetShutCutData vNetData = new C0303_tagCSetShutCutData(); |
| | | vNetData.Setting = setting; |
| | | GameNetSystem.Instance.SendInfo(vNetData); |
| | | } |
| | | } |
| | | |
| | | private void BeforePlayerDataInitializeEvent() |
| | | { |
| | | setting = null; |
| | | setting = new string(UCharacter, 100); |
| | | PlayerDatas.Instance.baseData.Setting = setting; |
| | | } |
| | | |
| | | } |
| | | |
| | | public enum QuickSettingType |
| | | { |
| | | AutoFight_Cost, //自动战斗 几倍消耗 |
| | | AutoFight_Speed, //几倍速度 |
| | | AutoFight_FightPower, //是否高战力停止 |
| | | AutoFight_Open, //是否开启自动战斗 |
| | | } |
| | | |
| | | public class QuickSettingRange |
| | | { |
| | | public QuickSettingType type; |
| | | public int index; |
| | | public int length; |
| | | public int single; |
| | | |
| | | public QuickSettingRange(QuickSettingType type, int start, int length, int single = 0) |
| | | { |
| | | this.type = type; |
| | | this.index = start; |
| | | this.length = length; |
| | | this.single = single == 0 ? length : single; |
| | | } |
| | | } |
copy from Main/Component/UI/Common/FuncEnable.cs.meta
copy to Main/System/Setting/QuickSetting.cs.meta
File was copied from Main/Component/UI/Common/FuncEnable.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e034d1a3f772bb44bbbcd4273f5084e1 |
| | | timeCreated: 1516430103 |
| | | licenseType: Free |
| | | guid: 591bd551698e54c42bb51c4b2af7ae0e |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | |
| | | |
| | | public void LetFPSUnLimit() |
| | | { |
| | | Application.targetFrameRate = 1000; |
| | | // Application.targetFrameRate = 1000; |
| | | } |
| | | |
| | | private void OnSwitchAccount() |
| | |
| | | |
| | | // 任务状态 1-进行中 2-可领取 |
| | | public int GetMainTaskState() |
| | | { |
| | | { |
| | | return mainTask.State; |
| | | } |
| | | |
| | | //还需完成多少个任务 |
| | | public int GetNeedFinishTaskCount(int taskID) |
| | | { |
| | | var taskConfig = TaskConfig.Get(taskID); |
| | | return taskConfig.Index - TaskConfig.Get(mainTask.TaskID).Index + 1; |
| | | } |
| | | |
| | | } |
| | |
| | | //过滤不播放的情况 |
| | | if (!CanOpen()) |
| | | { |
| | | m_Hints.Clear(); |
| | | return; |
| | | } |
| | | |
| | |
| | | |
| | | static bool CanOpen() |
| | | { |
| | | // if (UIManager.Instance.IsOpened<HeroCallResultWin>()) |
| | | // { |
| | | |
| | | // if (HappyXBModel.Instance.isXBCoolTime) |
| | | // return false; |
| | | // } |
| | | if (HappyXBModel.Instance.isXBCoolTime) |
| | | return false; |
| | | return true; |
| | | } |
| | | |
| | |
| | | } |
| | | private void OnConfirm() |
| | | { |
| | | CloseWindow(); |
| | | if (ConfirmCancel.OnToggleConfirmEvent != null) |
| | | { |
| | | ConfirmCancel.OnToggleConfirmEvent(true, m_Toggle.isOn); |
| | |
| | | { |
| | | ConfirmCancel.OnToggleSingleConfirmEvent(m_Toggle.isOn); |
| | | } |
| | | CloseWindow(); |
| | | } |
| | | |
| | | private void OnCancel() |
| | | { |
| | | CloseWindow(); |
| | | if (ConfirmCancel.OnToggleConfirmEvent != null) |
| | | { |
| | | ConfirmCancel.OnToggleConfirmEvent(false, m_Toggle.isOn); |
| | |
| | | { |
| | | ConfirmCancel.OnToggleSingleConfirmEvent(m_Toggle.isOn); |
| | | } |
| | | CloseWindow(); |
| | | } |
| | | |
| | | private void OnCancelEx() |
| | | { |
| | | CloseWindow(); |
| | | if (ConfirmCancel.OnToggleConfirmEventEx != null) |
| | | { |
| | | ConfirmCancel.OnToggleConfirmEventEx(false, m_Toggle.isOn); |
| | | } |
| | | CloseWindow(); |
| | | } |
| | | } |
| | | |
| | |
| | | _image.overrideSprite = sprite; |
| | | } |
| | | |
| | | public static void SetItemSprite(this Image _image, int itemID) |
| | | { |
| | | if (_image == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var itemConfig = ItemConfig.Get(itemID); |
| | | if (itemConfig == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var sprite = UILoader.LoadSprite("icon", itemConfig.IconKey); |
| | | _image.overrideSprite = sprite; |
| | | } |
| | | |
| | | public static void SetSkillSprite(this Image _image, int skillID) |
| | | { |
| | | if (_image == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var skillConfig = SkillConfig.Get(skillID); |
| | | if (skillConfig == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var sprite = UILoader.LoadSprite("SkillIcon", skillConfig.IconName); |
| | | _image.overrideSprite = sprite; |
| | | } |
| | | |
| | | public static void SetActive(this Component compoent, bool active) |
| | | { |
| | | if (compoent != null) |
| | |
| | | GoldPaper = 19, //金票 19, |
| | | Silver = 20, //银子 20, |
| | | SilverPaper = 21, //银票 21, |
| | | FightPoint = 22, //战斗值(锤子) 22, |
| | | UseHarmerCount = 22, //锤子消耗倍数 22, |
| | | HappyPoint = 23, //娱乐值 23, |
| | | MapID = 24, //角色所在地图 24, |
| | | PosX = 25, //角色坐标 25, |
| | |
| | | WarehouseLV = 99, //仓库等级 99 |
| | | EquipShowSwitch = 100, //装备显隐开关 100 |
| | | LuckValue = 101, //幸运值 101 |
| | | ExAttr1 = 102, //扩展属性1 102魔仆伤害24 |
| | | ExAttr2 = 103, //扩展属性2 103组队是否需要审核 |
| | | ExAttr1 = 102, //扩展属性1 102 主线已通关关卡 |
| | | ExAttr2 = 103, //扩展属性2 103 主线当前刷怪所在章节关卡记录 |
| | | ExAttr3 = 104, //扩展属性3 104元素攻击26 |
| | | ExAttr4 = 105, //扩展属性4 105元素防御27 |
| | | ExAttr5 = 106, //扩展属性5 106 |
| | |
| | | } |
| | | |
| | | //例子 |
| | | //大于24小时显示:x天xx小时xx分 |
| | | //小于24小时显示:xx:xx:xx |
| | | public static string SecondsToDHMSEx(int _seconds) |
| | | { |
| | | int days = _seconds / 86400; |
| | | int hours = _seconds % 86400 / 3600; |
| | | int mins = _seconds % 3600 / 60; |
| | | int seconds = _seconds % 60; |
| | | if (days > 0) |
| | | { |
| | | return StringUtility.Contact(days, Language.Get("L1074"), hours.ToString("D2"), Language.Get("L1072"), mins.ToString("D2"), Language.Get("L1073")); |
| | | } |
| | | return StringUtility.Contact(hours.ToString("D2"), ":", mins.ToString("D2"), ":", seconds.ToString("D2")); |
| | | } |
| | | //例子 |
| | | //x天 |
| | | //x时 |
| | | //x分x秒 |
| | |
| | | public static void SetIconWithMoneyType(this Image _image, int moneyType) |
| | | { |
| | | if (_image == null) return; |
| | | string iconKey = StringUtility.Contact("Money_Type_", moneyType); |
| | | _image.SetSprite(iconKey); |
| | | } |
| | | |
| | | public static void SetSmallIconWithMoneyType(this Image _image, int moneyType) |
| | | { |
| | | if (_image == null) return; |
| | | string iconKey = StringUtility.Contact("SmallMoney", moneyType); |
| | | _image.SetSprite(iconKey); |
| | | // string iconKey = StringUtility.Contact("Money_Type_", moneyType); |
| | | if (GeneralDefine.MoneyDisplayModel.ContainsKey(moneyType)) |
| | | { |
| | | _image.SetOrgSprite(ItemConfig.Get(GeneralDefine.MoneyDisplayModel[moneyType]).IconKey); |
| | | } |
| | | else |
| | | { |
| | | Debug.LogError("MoneyDisplayModel 为配置货币类型:" + moneyType); |
| | | } |
| | | } |
| | | |
| | | public static string GetIconNameWithMoneyType(int moneyType) |
| | | { |
| | | return StringUtility.Contact("Money_Type_", moneyType); |
| | | if (GeneralDefine.MoneyDisplayModel.ContainsKey(moneyType)) |
| | | { |
| | | return ItemConfig.Get(GeneralDefine.MoneyDisplayModel[moneyType]).IconKey; |
| | | } |
| | | else |
| | | { |
| | | Debug.LogError("MoneyDisplayModel 为配置货币类型:" + moneyType); |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | public static readonly Color s_NavyYellow = new Color32(242, 238, 2, 255); //f2ee02 |
| | | public static readonly Color s_LightGreen = new Color32(42, 227, 55, 255);//2ae337 |
| | | public static readonly Color s_LightWhite = new Color32(245, 246, 230, 255); //f5f6e6 |
| | | public static readonly Color s_Gray = new Color32(132, 121, 123, 255); //84797b |
| | | public static readonly Color s_Gray = new Color32(104, 104, 104,255); //bbbbbb |
| | | public static readonly Color s_Gold = new Color32(255, 239, 71, 255);//ffef47 |
| | | public static readonly Color s_EarthYellow = new Color32(248, 152, 59, 255);//f8983b |
| | | |
| | |
| | | case TextColType.LightGreen: |
| | | return StringUtility.Contact("<color=#8ddc11>", msg, "</color>"); |
| | | case TextColType.Gray: |
| | | return StringUtility.Contact("<color=#84797b>", msg, "</color>"); |
| | | return StringUtility.Contact("<color=#bbbbbb>", msg, "</color>"); |
| | | case TextColType.lightYellow: |
| | | return StringUtility.Contact("<color=#fcedb9>", msg, "</color>"); |
| | | case TextColType.NavyYellow: |
| | |
| | | { |
| | | return string.Empty; |
| | | } |
| | | return GetRealmColorByLv(realmLv, config.Name, bright); |
| | | return AppendColor(realmLv, config.Name, bright); |
| | | } |
| | | |
| | | //strFormat附加 境界名以外的文字 |
| | |
| | | // return GetRealmColorByLv(realmLv, string.Format(strFormat, config.Name), bright); |
| | | // } |
| | | |
| | | public static string GetRealmColorByLv(int realmLv, string msg, bool bright = true) |
| | | { |
| | | var config = RealmConfig.Get(realmLv); |
| | | if (config == null) |
| | | { |
| | | return string.Empty; |
| | | } |
| | | switch (config.Quality) |
| | | { |
| | | case 1: |
| | | return StringUtility.Contact("<color=#", bright ? "666666" : "dddddd", ">", msg, "</color>"); |
| | | case 2: |
| | | return StringUtility.Contact("<color=#", bright ? "00b337" : "66ff00", ">", msg, "</color>"); |
| | | case 3: |
| | | return StringUtility.Contact("<color=#", bright ? "0066ff" : "00c6ff", ">", msg, "</color>"); |
| | | case 4: |
| | | return StringUtility.Contact("<color=#", bright ? "ff00f6" : "f000ff", ">", msg, "</color>"); |
| | | case 5: |
| | | return StringUtility.Contact("<color=#", bright ? "ff6600" : "ff9000", ">", msg, "</color>"); |
| | | case 6: |
| | | return StringUtility.Contact("<color=#", bright ? "ff0000" : "ff0000", ">", msg, "</color>"); |
| | | default: |
| | | return msg; |
| | | } |
| | | } |
| | | // public static string GetRealmColorByLv(int realmLv, string msg, bool bright = true) |
| | | // { |
| | | // var config = RealmConfig.Get(realmLv); |
| | | // if (config == null) |
| | | // { |
| | | // return string.Empty; |
| | | // } |
| | | // switch (config.Quality) |
| | | // { |
| | | // case 1: |
| | | // return StringUtility.Contact("<color=#", bright ? "666666" : "dddddd", ">", msg, "</color>"); |
| | | // case 2: |
| | | // return StringUtility.Contact("<color=#", bright ? "00b337" : "66ff00", ">", msg, "</color>"); |
| | | // case 3: |
| | | // return StringUtility.Contact("<color=#", bright ? "0066ff" : "00c6ff", ">", msg, "</color>"); |
| | | // case 4: |
| | | // return StringUtility.Contact("<color=#", bright ? "ff00f6" : "f000ff", ">", msg, "</color>"); |
| | | // case 5: |
| | | // return StringUtility.Contact("<color=#", bright ? "ff6600" : "ff9000", ">", msg, "</color>"); |
| | | // case 6: |
| | | // return StringUtility.Contact("<color=#", bright ? "ff0000" : "ff0000", ">", msg, "</color>"); |
| | | // default: |
| | | // return msg; |
| | | // } |
| | | // } |
| | | |
| | | //物品 各功能品质 从精良1品质 对应 3开始 |
| | | /// <summary> |