Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | break; |
| | | case 31230: |
| | | |
| | | break;
|
| | | case 31160: |
| | | BattleHint.Instance.UpdateDungeonHelp(); |
| | | break; |
| | | } |
| | | } |
| | |
| | |
|
| | | public float forceAutoFightTime;
|
| | |
|
| | | private float m_ChkOpenAutoEscapeTime;
|
| | |
|
| | | private DungeonModel m_DungeonModel;
|
| | | public DungeonModel dungeonModel { get { return m_DungeonModel ?? (m_DungeonModel = ModelCenter.Instance.GetModel<DungeonModel>()); } }
|
| | |
|
| | | protected sealed override void OnUpdate()
|
| | | {
|
| | | base.OnUpdate();
|
| | |
|
| | | if (!forceAutoFight)
|
| | | {
|
| | | if (Time.realtimeSinceStartup - m_ChkOpenAutoEscapeTime > 2f)
|
| | | {
|
| | | int _dgDataID = dungeonModel.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID);
|
| | | var dungeonOpen = Config.Instance.Get<DungeonOpenTimeConfig>(_dgDataID);
|
| | |
|
| | | if (dungeonOpen != null)
|
| | | {
|
| | | if (dungeonOpen.DoFight == 1)
|
| | | {
|
| | | forceAutoFight = true;
|
| | | }
|
| | | }
|
| | |
|
| | | m_ChkOpenAutoEscapeTime = Time.realtimeSinceStartup;
|
| | | }
|
| | | }
|
| | |
|
| | | if (forceAutoFight
|
| | | #if UNITY_EDITOR
|
| | | && RuntimeLogUtility.s_forceAutoFight
|
| | |
| | | {
|
| | | PlayerTaskDatas _model = ModelCenter.Instance.GetModel<PlayerTaskDatas>();
|
| | | m_CanCollect = _model.IsGather(NpcConfig.NPCID);
|
| | | Debug.LogFormat("Npc: {0} 是否可以采集: {1}", NpcConfig.NPCID, m_CanCollect);
|
| | | }
|
| | |
|
| | | if (!m_CanCollect)
|
| | |
| | | float _distSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, Pos);
|
| | | if (_distSqrt > Mathf.Pow(GeneralConfig.Instance.CloseNpcDist + NpcConfig.ModelRadius + 0.4f, 2))
|
| | | {
|
| | | MapTransferUtility.Instance.MoveToNPC(NpcConfig.NPCID);
|
| | | MapTransferUtility.Instance.MoveToNPC(NpcConfig.NPCID, (int)ServerInstID);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | Fight,
|
| | | }
|
| | | private E_MapTransferDoType m_MapTransferType;
|
| | | public E_MapTransferDoType MapTransferDoType {
|
| | | get {
|
| | | public E_MapTransferDoType MapTransferDoType
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_MapTransferType;
|
| | | }
|
| | | set {
|
| | | set
|
| | | {
|
| | | m_MapTransferType = value;
|
| | | #if UNITY_EDITOR
|
| | | // Debug.LogFormat("设置方式: {0}", m_MapTransferType);
|
| | |
| | | #endregion
|
| | |
|
| | | #region npc
|
| | | public int NpcID {
|
| | | public int NpcID
|
| | | {
|
| | | get; set;
|
| | | }
|
| | | #endregion
|
| | |
| | |
|
| | | public void MoveToNPC(int npcID, int sid = 0)
|
| | | {
|
| | | if (sid != 0)
|
| | | {
|
| | | GActor _actor = GAMgr.Instance.GetBySID((uint)sid);
|
| | | if (_actor != null)
|
| | | {
|
| | | NpcID = npcID;
|
| | | MapTransferDoType = E_MapTransferDoType.Npc;
|
| | |
|
| | | MoveToExistNpc(npcID, _actor);
|
| | |
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | NPCConfig _config = Config.Instance.Get<NPCConfig>(npcID);
|
| | |
|
| | | if (_config == null)
|
| | |
| | | {
|
| | | _npc = GAMgr.Instance.GetCloserNPC(_hero.Pos, npcID);
|
| | |
|
| | | // 目标点, 默认为主角坐标, 找不到任务终点的时候不移动
|
| | | Vector3 _destPos = _hero.Pos;
|
| | | MoveToExistNpc(npcID, _npc);
|
| | | }
|
| | | }
|
| | |
|
| | | // 计算当前坐标与目标角色的坐标差
|
| | | //GActor _npc = GAMgr.Instance.GetCloserNPC(_hero.Pos, npcID);
|
| | | //// 如果在当前地图找得到已创建出来最近的目标
|
| | | //if (_npc != null)
|
| | | //{
|
| | | // _destPos = _npc.Pos;
|
| | | //}
|
| | | //else
|
| | | //{
|
| | | Vector2 _calculPos = _destPos;
|
| | | if (_findLocation)
|
| | | private void MoveToExistNpc(int npcID, GActor npc)
|
| | | {
|
| | | GA_Hero _hero = PlayerDatas.Instance.hero;
|
| | |
|
| | | NPCConfig _config = Config.Instance.Get<NPCConfig>(npcID);
|
| | |
|
| | | // 目标点, 默认为主角坐标, 找不到任务终点的时候不移动
|
| | | Vector3 _destPos = _hero.Pos;
|
| | |
|
| | | // 获取NPC位置数据
|
| | | GAStaticDefine.NPCLocation _npcLocation;
|
| | | var _findLocation = GAStaticDefine.TryGetMapNPCLocation(npcID, out _npcLocation);
|
| | |
|
| | | Vector2 _calculPos = _destPos;
|
| | | if (_findLocation)
|
| | | {
|
| | | _calculPos = _npcLocation.position;
|
| | | }
|
| | | _destPos = new Vector3(_calculPos.x, _hero.Pos.y, _calculPos.y);
|
| | | //}
|
| | |
|
| | | // 判断距离
|
| | | float _distSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, _destPos);
|
| | |
|
| | | // 判断是否需要骑马移动
|
| | | if (_distSqrt > Mathf.Pow(7, 2))
|
| | | {
|
| | | DTC0428_tagPlayerRideHorse.Send_tagPlayerRideHorse(true);
|
| | | }
|
| | |
|
| | | float _chkDist = Mathf.Max(GeneralConfig.Instance.CloseNpcDist + _config.ModelRadius - 0.3f, 0);
|
| | |
|
| | | if (_config.NPCType == (int)E_NpcType.OpenWorldMap)
|
| | | {
|
| | | _chkDist = 1;
|
| | | }
|
| | |
|
| | | // 针对挖洞对象保持距离为0
|
| | | if (npc != null && _config.Dig == 1)
|
| | | {
|
| | | _chkDist = 0;
|
| | | }
|
| | |
|
| | | // 大于配置的距离, 移动至
|
| | | if (_distSqrt > Mathf.Pow(_chkDist, 2))
|
| | | {
|
| | | if (_config.NPCType == (int)E_NpcType.Fight)
|
| | | {
|
| | | _calculPos = _npcLocation.position;
|
| | | _hero.MoveToPosition(_destPos, _npcLocation.scope);
|
| | | }
|
| | | _destPos = new Vector3(_calculPos.x, _hero.Pos.y, _calculPos.y);
|
| | | //}
|
| | |
|
| | | // 判断距离
|
| | | float _distSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, _destPos);
|
| | |
|
| | | // 判断是否需要骑马移动
|
| | | if (_distSqrt > Mathf.Pow(7, 2))
|
| | | else
|
| | | {
|
| | | DTC0428_tagPlayerRideHorse.Send_tagPlayerRideHorse(true);
|
| | | if (npc != null)
|
| | | {
|
| | | _destPos = npc.Pos;
|
| | | }
|
| | |
|
| | | _hero.MoveToPosition(_destPos, _chkDist);
|
| | | }
|
| | |
|
| | | float _chkDist = Mathf.Max(GeneralConfig.Instance.CloseNpcDist + _config.ModelRadius - 0.3f, 0);
|
| | |
|
| | | if (_config.NPCType == (int)E_NpcType.OpenWorldMap)
|
| | | if (s_OnHeroStartMoveToNPC != null)
|
| | | {
|
| | | _chkDist = 1;
|
| | | s_OnHeroStartMoveToNPC();
|
| | | }
|
| | |
|
| | | // 针对挖洞对象保持距离为0
|
| | | if (_npc != null && _config.Dig == 1)
|
| | | {
|
| | | _chkDist = 0;
|
| | | }
|
| | |
|
| | | // 大于配置的距离, 移动至
|
| | | if (_distSqrt > Mathf.Pow(_chkDist, 2))
|
| | | }
|
| | | // 小于距离则判断目标的类型,执行相应的逻辑
|
| | | else
|
| | | {
|
| | | if (_config != null)
|
| | | {
|
| | | if (_config.NPCType == (int)E_NpcType.Fight)
|
| | | {
|
| | | _hero.MoveToPosition(_destPos, _npcLocation.scope);
|
| | | _hero.Behaviour.StartHandupAI();
|
| | | }
|
| | | else if (_config.NPCType == (int)E_NpcType.Collect)
|
| | | {
|
| | | GA_NpcCollect _collect = npc as GA_NpcCollect;
|
| | | if (_collect != null)
|
| | | {
|
| | | _collect.Arrive();
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (_npc != null)
|
| | | // 如果目标已经在之前搜索中确定了
|
| | | // 没确定其实在这里应该是异常情况
|
| | | if (npc != null)
|
| | | {
|
| | | _destPos = _npc.Pos;
|
| | | }
|
| | | _hero.LockTarget = npc;
|
| | | _hero.SelectTarget = npc;
|
| | |
|
| | | _hero.MoveToPosition(_destPos, _chkDist);
|
| | | }
|
| | | NPCInteractProcessor.InvokeEvent((E_NpcType)_config.NPCType, npcID, npc.ServerInstID);
|
| | |
|
| | | if (s_OnHeroStartMoveToNPC != null)
|
| | | {
|
| | | s_OnHeroStartMoveToNPC();
|
| | | }
|
| | | }
|
| | | // 小于距离则判断目标的类型,执行相应的逻辑
|
| | | else
|
| | | {
|
| | | if (_config != null)
|
| | | {
|
| | | if (_config.NPCType == (int)E_NpcType.Fight)
|
| | | {
|
| | | _hero.Behaviour.StartHandupAI();
|
| | | }
|
| | | else if (_config.NPCType == (int)E_NpcType.Collect)
|
| | | {
|
| | | GA_NpcCollect _collect = _npc as GA_NpcCollect;
|
| | | if (_collect != null)
|
| | | Vector3 _npc2heroDir = MathUtility.ForwardXZ(npc.Pos, _hero.Pos);
|
| | |
|
| | | if (_config.AutomaticFace == 1)
|
| | | {
|
| | | _collect.Arrive();
|
| | | npc.Forward = -_npc2heroDir;
|
| | | }
|
| | | _hero.Forward = _npc2heroDir;
|
| | | }
|
| | | // 会有为空的时候, 例如是小飞鞋飞的情况, 这里直接判断与配置的坐标的距离
|
| | | else
|
| | | {
|
| | | // 如果目标已经在之前搜索中确定了
|
| | | // 没确定其实在这里应该是异常情况
|
| | | if (_npc != null)
|
| | | {
|
| | | _hero.LockTarget = _npc;
|
| | | _hero.SelectTarget = _npc;
|
| | |
|
| | | NPCInteractProcessor.InvokeEvent((E_NpcType)_config.NPCType, npcID, _npc.ServerInstID);
|
| | |
|
| | | Vector3 _npc2heroDir = MathUtility.ForwardXZ(_npc.Pos, _hero.Pos);
|
| | |
|
| | | if (_config.AutomaticFace == 1)
|
| | | {
|
| | | _npc.Forward = -_npc2heroDir;
|
| | | }
|
| | | _hero.Forward = _npc2heroDir;
|
| | | }
|
| | | // 会有为空的时候, 例如是小飞鞋飞的情况, 这里直接判断与配置的坐标的距离
|
| | | else
|
| | | {
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | else if (_npcConfig.NPCType == (int)E_NpcType.Collect)
|
| | | {
|
| | | float _chkDist = GeneralConfig.Instance.CloseNpcDist + _npcConfig.ModelRadius + 0.3f;
|
| | | if (_chkDistSqrt <= Mathf.Pow(_chkDist, 2))
|
| | | {
|
| | | if (!UserInputHandler.isTouched
|
| | | && (_hero.SkillMgr.CurCastSkill == null || _hero.SkillMgr.CurCastSkill.SkillCompelete))
|
| | | {
|
| | | NPCInteractProcessor.InvokeEvent(E_NpcType.Func, NpcID, _npc.ServerInstID);
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Wednesday, November 22, 2017 |
| | | //-------------------------------------------------------- |
| | | |
| | | using Snxxz.UI; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using TableConfig; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI { |
| | | |
| | | |
| | | public class ActivitySettleWin : Window |
| | | { |
| | | [SerializeField] List<ItemCell> activityItemCells=new List<ItemCell>(); |
| | | [SerializeField] RectTransform container_ActivityReward; |
| | | [SerializeField] GameObject activityNullReawrd; |
| | | [SerializeField] List<ItemCell> achieveItemCells=new List<ItemCell>(); |
| | | [SerializeField] RectTransform container_AchieveReward; |
| | | [SerializeField] GameObject achieveNullReawrd; |
| | | [SerializeField] Button rewardGetBtn; |
| | | |
| | | DungeonModel m_DungeonModel; |
| | | DungeonModel dungeonModel { |
| | | get { |
| | | return m_DungeonModel ?? (m_DungeonModel = ModelCenter.Instance.GetModel<DungeonModel>()); |
| | | } |
| | | } |
| | | |
| | | ItemTipsModel _itemTipsModel; |
| | | ItemTipsModel itemTipsModel |
| | | { |
| | | get |
| | | { |
| | | return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>()); |
| | | } |
| | | } |
| | | |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | rewardGetBtn.onClick.AddListener(CloseClick); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | ShowActivityReward(); |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | dungeonModel.dungeonResult = default(DungeonResult); |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | } |
| | | #endregion |
| | | |
| | | void ShowActivityReward() |
| | | { |
| | | foreach (var item in achieveItemCells) { |
| | | item.gameObject.SetActive(false); |
| | | } |
| | | foreach (var item in activityItemCells) { |
| | | item.gameObject.SetActive(false); |
| | | } |
| | | var actiivityItems = dungeonModel.dungeonResult.itemInfo; |
| | | bool hasReward = actiivityItems != null && actiivityItems.Length > 0; |
| | | container_ActivityReward.gameObject.SetActive(hasReward); |
| | | activityNullReawrd.SetActive(!hasReward); |
| | | if (hasReward) { |
| | | for (int i = 0; i < actiivityItems.Length; i++) { |
| | | activityItemCells[i].gameObject.SetActive(true); |
| | | ItemCell itemCell = activityItemCells[i]; |
| | | ServerItem serverItem = actiivityItems[i]; |
| | | ItemCellModel cellModel = new ItemCellModel(serverItem.ItemID,false,(ulong)serverItem.Count,serverItem.IsBind |
| | | ,"",PackType.rptDeleted,false,ConfigParse.Analysis(serverItem.UserData)); |
| | | itemCell.Init(cellModel); |
| | | itemCell.cellBtn.RemoveAllListeners(); |
| | | itemCell.cellBtn.AddListener(() => { |
| | | ShowItemDetails(serverItem); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | var achieveItems = dungeonModel.dungeonResult.succItemInfo; |
| | | hasReward = achieveItems != null && achieveItems.Length > 0; |
| | | container_AchieveReward.gameObject.SetActive(hasReward); |
| | | achieveNullReawrd.SetActive(!hasReward); |
| | | if (hasReward) { |
| | | for (int i = 0; i < achieveItems.Length; i++) { |
| | | achieveItemCells[i].gameObject.SetActive(true); |
| | | ItemCell itemCell = achieveItemCells[i]; |
| | | ServerItem serverItem = achieveItems[i]; |
| | | ItemCellModel cellModel = new ItemCellModel(serverItem.ItemID,false,(ulong)serverItem.Count, serverItem.IsBind |
| | | ,"" ,PackType.rptDeleted,false,ConfigParse.Analysis(serverItem.UserData)); |
| | | itemCell.Init(cellModel); |
| | | itemCell.cellBtn.RemoveAllListeners(); |
| | | itemCell.cellBtn.AddListener(() => { |
| | | ShowItemDetails(serverItem); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private void ShowItemDetails(ServerItem serverItem) |
| | | { |
| | | //ItemWinModel itemWinModel = ItemCommonCtrl.Instance.OnSingleClickItemCell(serverItem.ItemID); |
| | | //itemWinModel.itemCount = serverItem.ItemCount; |
| | | //itemWinModel.isSuite = serverItem.IsSuite; |
| | | //itemWinModel.isBind = serverItem.IsBind; |
| | | //itemWinModel.userDataDict = serverItem.UserData == null ? null : ConfigParse.Analysis(serverItem.UserData); |
| | | //ItemPopModel.Instance.SetDefaultShowUIDict(itemWinModel, false); |
| | | //itemWinModel.SetShowWin(itemWinModel); |
| | | ItemAttrData attrData = new ItemAttrData(serverItem.ItemID,false, (ulong)serverItem.Count,-1,serverItem.IsBind |
| | | ,false,PackType.rptDeleted,"", ConfigParse.Analysis(serverItem.UserData)); |
| | | itemTipsModel.SetItemTipsModel(attrData); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Wednesday, November 22, 2017
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using Snxxz.UI;
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | |
|
| | | public class ActivitySettleWin : Window
|
| | | {
|
| | | [SerializeField] List<ItemCell> activityItemCells = new List<ItemCell>();
|
| | | [SerializeField] RectTransform container_ActivityReward;
|
| | | [SerializeField] GameObject activityNullReawrd;
|
| | | [SerializeField] List<ItemCell> achieveItemCells = new List<ItemCell>();
|
| | | [SerializeField] RectTransform container_AchieveReward;
|
| | | [SerializeField] GameObject achieveNullReawrd;
|
| | | [SerializeField] Button rewardGetBtn;
|
| | |
|
| | | DungeonModel m_DungeonModel;
|
| | | DungeonModel dungeonModel
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_DungeonModel ?? (m_DungeonModel = ModelCenter.Instance.GetModel<DungeonModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | ItemTipsModel _itemTipsModel;
|
| | | ItemTipsModel itemTipsModel
|
| | | {
|
| | | get
|
| | | {
|
| | | return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | rewardGetBtn.onClick.AddListener(CloseClick);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | ShowActivityReward();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | dungeonModel.dungeonResult = default(DungeonResult);
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | void ShowActivityReward()
|
| | | {
|
| | | foreach (var item in achieveItemCells)
|
| | | {
|
| | | item.gameObject.SetActive(false);
|
| | | }
|
| | | foreach (var item in activityItemCells)
|
| | | {
|
| | | item.gameObject.SetActive(false);
|
| | | }
|
| | | var actiivityItems = dungeonModel.dungeonResult.itemInfo;
|
| | | bool hasReward = actiivityItems != null && actiivityItems.Length > 0;
|
| | | container_ActivityReward.gameObject.SetActive(hasReward);
|
| | | activityNullReawrd.SetActive(!hasReward);
|
| | | if (hasReward)
|
| | | {
|
| | | for (int i = 0; i < actiivityItems.Length; i++)
|
| | | {
|
| | | if (i < activityItemCells.Count)
|
| | | {
|
| | | activityItemCells[i].gameObject.SetActive(true);
|
| | | ItemCell itemCell = activityItemCells[i];
|
| | | ServerItem serverItem = actiivityItems[i];
|
| | | ItemCellModel cellModel = new ItemCellModel(serverItem.ItemID, false, (ulong)serverItem.Count, serverItem.IsBind
|
| | | , "", PackType.rptDeleted, false, ConfigParse.Analysis(serverItem.UserData));
|
| | | itemCell.Init(cellModel);
|
| | | itemCell.cellBtn.RemoveAllListeners();
|
| | | itemCell.cellBtn.AddListener(() =>
|
| | | {
|
| | | ShowItemDetails(serverItem);
|
| | | });
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | var achieveItems = dungeonModel.dungeonResult.succItemInfo;
|
| | | hasReward = achieveItems != null && achieveItems.Length > 0;
|
| | | container_AchieveReward.gameObject.SetActive(hasReward);
|
| | | achieveNullReawrd.SetActive(!hasReward);
|
| | | if (hasReward)
|
| | | {
|
| | | for (int i = 0; i < achieveItems.Length; i++)
|
| | | {
|
| | | if (i < achieveItemCells.Count)
|
| | | {
|
| | | achieveItemCells[i].gameObject.SetActive(true);
|
| | | ItemCell itemCell = achieveItemCells[i];
|
| | | ServerItem serverItem = achieveItems[i];
|
| | | ItemCellModel cellModel = new ItemCellModel(serverItem.ItemID, false, (ulong)serverItem.Count, serverItem.IsBind
|
| | | , "", PackType.rptDeleted, false, ConfigParse.Analysis(serverItem.UserData));
|
| | | itemCell.Init(cellModel);
|
| | | itemCell.cellBtn.RemoveAllListeners();
|
| | | itemCell.cellBtn.AddListener(() =>
|
| | | {
|
| | | ShowItemDetails(serverItem);
|
| | | });
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | private void ShowItemDetails(ServerItem serverItem)
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(serverItem.ItemID, false, (ulong)serverItem.Count, -1, serverItem.IsBind
|
| | | , false, PackType.rptDeleted, "", ConfigParse.Analysis(serverItem.UserData));
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | WindowCenter.Instance.jumpWindowCloseEvent += CloseJumpWindow;
|
| | | |
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | |
| | | protected override void OnPreOpen()
|
| | | {
|
| | | ComposeModel.ResetModel();
|
| | | if(WindowJumpMgr.Instance.IsJumpState)
|
| | |
|
| | | if (WindowJumpMgr.Instance.IsJumpState && ComposeModel.secondType == 0)
|
| | | {
|
| | | if(ComposeModel.CurComposeModel != null)
|
| | | if (ComposeModel.CurComposeModel != null)
|
| | | {
|
| | | ComposeModel.SetJumpToModel((ComposeFuncType)ComposeModel.CurComposeModel.firstType,
|
| | | ComposeModel.CurComposeModel.secondType, ComposeModel.CurComposeModel.thirdType);
|
| | |
| | | {
|
| | | if (!WindowJumpMgr.Instance.IsJumpState)
|
| | | {
|
| | | ComposeModel.SetCurComposeModel(null);
|
| | | WindowCenter.Instance.Open<MainInterfaceWin>();
|
| | | |
| | | }
|
| | | }
|
| | |
|
| | | private void CloseJumpWindow(Window win)
|
| | | {
|
| | | if(win as ComposeWin)
|
| | | {
|
| | | if (WindowJumpMgr.Instance.jumpPhase <= 1)
|
| | | {
|
| | | ComposeModel.SetCurComposeModel(null);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | [SerializeField] FunctionButton functionButtonStrengthen;
|
| | | [SerializeField] FunctionButtonGroup funcBtnGroup;
|
| | |
|
| | | GodBeastModel beastModel { get { return ModelCenter.Instance.GetModel<GodBeastModel>(); } }
|
| | | DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } }
|
| | | protected override void BindController()
|
| | | {
|
| | |
| | | {
|
| | | dogzModel.SetDefaultSelectDogz();
|
| | | }
|
| | | else
|
| | | {
|
| | | if(dogzModel.presentSelectDogz == 0)
|
| | | {
|
| | | dogzModel.SetDefaultSelectDogz();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | | if(!WindowJumpMgr.Instance.IsJumpState && functionOrder == 0)
|
| | | {
|
| | | if(dogzModel.dogzFuncRedpoint.state != RedPointState.None)
|
| | | {
|
| | | functionOrder = functionButtonDogz.order;
|
| | | }
|
| | | else if(beastModel.redPointStre1.state != RedPointState.None)
|
| | | {
|
| | | functionOrder = functionButtonStrengthen.order;
|
| | | }
|
| | | }
|
| | | funcBtnGroup.TriggerByOrder(functionOrder);
|
| | | }
|
| | |
|
| | |
| | | private void OnDogzStrengthen()
|
| | | {
|
| | | CloseChild();
|
| | | functionOrder = 1;
|
| | | functionOrder = functionButtonStrengthen.order;
|
| | | WindowCenter.Instance.Open<GodBeastReinforcementWin>();
|
| | | }
|
| | |
|
| | | private void OnDogz()
|
| | | {
|
| | | CloseChild();
|
| | | functionOrder = 0;
|
| | | functionOrder = functionButtonDogz.order;
|
| | | WindowCenter.Instance.Open<DogzActiveWin>();
|
| | | }
|
| | |
|
| | |
| | | if(itemTipsModel.curAttrData.itemConfig.MaxSkillCnt > 0)
|
| | | {
|
| | | promptText.gameObject.SetActive(true);
|
| | | promptText.text = Language.Get("BoxUseCntTip",StringUtility.Contact(useCnt, "/", itemTipsModel.curAttrData.itemConfig.MaxSkillCnt));
|
| | | promptText.text = Language.Get("BoxUseCntTip", StringUtility.Contact(useCnt, "/", itemTipsModel.curAttrData.itemConfig.MaxSkillCnt));
|
| | | if (useCnt < itemTipsModel.curAttrData.itemConfig.MaxSkillCnt)
|
| | | {
|
| | | promptText.color = UIHelper.s_DarkGreenColor;
|
| | | }
|
| | | else
|
| | | {
|
| | | promptText.color = UIHelper.s_DarkRedColor;
|
| | | }
|
| | | |
| | | }
|
| | | else
|
| | | {
|
| | |
| | | yield return null;
|
| | | //this.transform.localScale = Vector3.one;
|
| | | //itemTipsModel.SetCommonTipPos(bgObj);
|
| | | bottomPart.gameObject.SetActive(false);
|
| | | bottomPart.gameObject.SetActive(true);
|
| | | bgObj.localPosition = Vector3.zero;
|
| | | tipAlpha.alpha = 1;
|
| | | }
|
| | |
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | this.transform.SetAsLastSibling();
|
| | | |
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | |
| | | {
|
| | | promptText.gameObject.SetActive(true);
|
| | | promptText.text = Language.Get("BoxUseCntTip", StringUtility.Contact(useCnt, "/", itemTipsModel.curAttrData.itemConfig.MaxSkillCnt));
|
| | | if (useCnt < itemTipsModel.curAttrData.itemConfig.MaxSkillCnt)
|
| | | {
|
| | | promptText.color = UIHelper.s_DarkGreenColor;
|
| | | }
|
| | | else
|
| | | {
|
| | | promptText.color = UIHelper.s_DarkRedColor;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | IEnumerator SetPanelScale()
|
| | | {
|
| | | yield return null;
|
| | | bottomPart.gameObject.SetActive(false);
|
| | | bottomPart.gameObject.SetActive(true);
|
| | | //itemTipsModel.SetCommonTipPos(bgObj);
|
| | | //this.transform.localScale = Vector3.one;
|
| | | tipAlpha.alpha = 1;
|
| | |
| | | {
|
| | | public class BattleHint : Singleton<BattleHint>
|
| | | {
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | |
|
| | | public BattleHint()
|
| | | {
|
| | | StageManager.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | | SysNotifyMgr.Instance.OnSystemNotifyEvent += OnSystemNotifyEvent;
|
| | | }
|
| | |
|
| | | private void OnStageLoadFinish()
|
| | | public void OnStageLoadFinish()
|
| | | {
|
| | | Clear();
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | if (cacheMapId != 0 && cacheMapId != 31160
|
| | | && mapId == 31160)
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(Co_LoadFinish());
|
| | | }
|
| | | var help = dungeonModel.mission;
|
| | | ancientKing = mapId != 31160 ? 0 : help.topPlayerID;
|
| | | cacheMapId = PlayerDatas.Instance.baseData.MapID;
|
| | | }
|
| | |
|
| | | public event Action battleHintUpdate;
|
| | | public event Action evenKillUpdate;
|
| | |
|
| | | Queue<string> battleHints = new Queue<string>();
|
| | | Queue<int> battleHints = new Queue<int>();
|
| | | Queue<string> evenKills = new Queue<string>();
|
| | |
|
| | | public void Receive(string msg)
|
| | | int ancientKing = 0;
|
| | | int cacheMapId = 0;
|
| | |
|
| | | IEnumerator Co_LoadFinish()
|
| | | {
|
| | | if (!(StageManager.Instance.CurrentStage is DungeonStage))
|
| | | yield return WaitingForSecondConst.WaitMS300;
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | if (mapId == 31160)
|
| | | {
|
| | | Receive(3);
|
| | | }
|
| | | }
|
| | |
|
| | | public void UpdateDungeonHelp()
|
| | | {
|
| | | var help = dungeonModel.mission;
|
| | | if (DTC0403_tagPlayerLoginLoadOK.finishedLogin)
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.MapID == 31160
|
| | | && help.topPlayerID == PlayerDatas.Instance.baseData.PlayerID
|
| | | && ancientKing != help.topPlayerID)
|
| | | {
|
| | | ancientKing = help.topPlayerID;
|
| | | Receive(1);
|
| | | }
|
| | | }
|
| | | ancientKing = help.topPlayerID;
|
| | | }
|
| | |
|
| | | private void OnSystemNotifyEvent(string msg)
|
| | | {
|
| | | if (!(StageManager.Instance.CurrentStage is DungeonStage)
|
| | | || StageManager.Instance.isLoading)
|
| | | {
|
| | | return;
|
| | | }
|
| | | battleHints.Enqueue(msg);
|
| | | if (StageManager.Instance.isLoading)
|
| | | if (msg.Equals("AncientBattlefield_8"))
|
| | | {
|
| | | return;
|
| | | Receive(2);
|
| | | }
|
| | | }
|
| | |
|
| | | public void Receive(int ancientType)
|
| | | {
|
| | | battleHints.Enqueue(ancientType);
|
| | | if (!WindowCenter.Instance.IsOpen<BattleHintWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<BattleHintWin>();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public bool TryGetBattleHint(out string msg)
|
| | | public void ReceiveEvenKill(string message, ArrayList list)
|
| | | {
|
| | | msg = string.Empty;
|
| | | if (PlayerDatas.Instance.baseData.MapID != 31160
|
| | | || !(StageManager.Instance.CurrentStage is DungeonStage)
|
| | | || StageManager.Instance.isLoading)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var evenKillCount = 0;
|
| | | if (list != null && list.Count > 0)
|
| | | {
|
| | | int.TryParse(list[0].ToString(), out evenKillCount);
|
| | | }
|
| | | if (evenKillCount == 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | message = message.Replace("%s0", evenKillCount.ToString());
|
| | | evenKills.Enqueue(message);
|
| | | if (!WindowCenter.Instance.IsOpen<BattleHintWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<BattleHintWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | if (evenKillUpdate != null)
|
| | | {
|
| | | evenKillUpdate();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public bool TryGetBattleHint(out int ancientType)
|
| | | {
|
| | | ancientType = 0;
|
| | | if (battleHints.Count > 0)
|
| | | {
|
| | | msg = battleHints.Dequeue();
|
| | | ancientType = battleHints.Dequeue();
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool TryGetEvenKill(out string message)
|
| | | {
|
| | | message = string.Empty;
|
| | | if (evenKills.Count > 0)
|
| | | {
|
| | | message = evenKills.Dequeue();
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | |
| | | public void Clear()
|
| | | {
|
| | | battleHints.Clear();
|
| | | evenKills.Clear();
|
| | | }
|
| | | }
|
| | | } |
| | |
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | |
| | |
|
| | | public class BattleHintWin : Window
|
| | | {
|
| | | [SerializeField] Image m_BattleHint;
|
| | | [SerializeField] RectTransform m_ContainerBattleHint;
|
| | | [SerializeField] RectTransform m_ContainerKing;
|
| | | [SerializeField] RectTransform m_ContainerEnemy;
|
| | | [SerializeField] RectTransform m_ContainerAncientRemind;
|
| | | [SerializeField] ScaleTween m_BattleHintTween;
|
| | | [SerializeField, Header("保留时间")] float m_KeepTime = 2f;
|
| | |
|
| | | bool inBattleHint = false;
|
| | | [SerializeField] RectTransform m_ContainerEvenKill;
|
| | | [SerializeField] ScaleTween m_EvenKillTween;
|
| | | [SerializeField] Text m_EvenKill;
|
| | | [SerializeField, Header("保留时间")] float m_EvenKillTime = 2f;
|
| | |
|
| | | bool isBattleHint = false;
|
| | | bool isEvenKill = false;
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | |
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | inBattleHint = false;
|
| | | m_BattleHintTween.gameObject.SetActive(false);
|
| | | m_ContainerBattleHint.gameObject.SetActive(false);
|
| | | m_ContainerEvenKill.gameObject.SetActive(false);
|
| | | isBattleHint = false;
|
| | | isEvenKill = false;
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | | DisplayBattleHint();
|
| | | DisplayEvenKill();
|
| | | BattleHint.Instance.battleHintUpdate += BattleHintUpdate;
|
| | | BattleHint.Instance.evenKillUpdate += EvenKillUpdate;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | | protected override void OnPreClose()
|
| | | {
|
| | | BattleHint.Instance.battleHintUpdate -= BattleHintUpdate;
|
| | | BattleHint.Instance.evenKillUpdate -= EvenKillUpdate;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | |
|
| | | private void BattleHintUpdate()
|
| | | {
|
| | | if (!inBattleHint)
|
| | | if (!isBattleHint)
|
| | | {
|
| | | DisplayBattleHint();
|
| | | }
|
| | |
| | |
|
| | | void DisplayBattleHint()
|
| | | {
|
| | | string iconKey = string.Empty;
|
| | | if (BattleHint.Instance.TryGetBattleHint(out iconKey))
|
| | | var ancientType = 0;
|
| | | if (BattleHint.Instance.TryGetBattleHint(out ancientType))
|
| | | {
|
| | | inBattleHint = true;
|
| | | m_BattleHint.SetSprite(iconKey);
|
| | | m_BattleHint.SetNativeSize();
|
| | | m_BattleHintTween.gameObject.SetActive(true);
|
| | | isBattleHint = true;
|
| | | m_ContainerKing.gameObject.SetActive(false);
|
| | | m_ContainerEnemy.gameObject.SetActive(false);
|
| | | m_ContainerAncientRemind.gameObject.SetActive(false);
|
| | | switch (ancientType)
|
| | | {
|
| | | case 1:
|
| | | m_ContainerKing.gameObject.SetActive(true);
|
| | | break;
|
| | | case 2:
|
| | | m_ContainerEnemy.gameObject.SetActive(true);
|
| | | break;
|
| | | case 3:
|
| | | m_ContainerAncientRemind.gameObject.SetActive(true);
|
| | | break;
|
| | | }
|
| | | m_ContainerBattleHint.gameObject.SetActive(true);
|
| | | m_BattleHintTween.SetStartState();
|
| | | m_BattleHintTween.Play(OnBattleHintTweenComplete);
|
| | | }
|
| | |
| | | StartCoroutine(Co_Complete());
|
| | | }
|
| | |
|
| | | private void EvenKillUpdate()
|
| | | {
|
| | | if (!isEvenKill)
|
| | | {
|
| | | DisplayEvenKill();
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayEvenKill()
|
| | | {
|
| | | string evenKill = string.Empty;
|
| | | if (BattleHint.Instance.TryGetEvenKill(out evenKill))
|
| | | {
|
| | | isEvenKill = true;
|
| | | m_EvenKill.text= evenKill;
|
| | | m_ContainerEvenKill.gameObject.SetActive(true);
|
| | | m_EvenKillTween.SetStartState();
|
| | | m_EvenKillTween.Play(OnEvenKillComplete);
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnEvenKillComplete()
|
| | | {
|
| | | StartCoroutine(Co_EvenKill());
|
| | | }
|
| | |
|
| | | IEnumerator Co_Complete()
|
| | | {
|
| | | yield return WaitingForSecondConst.GetWaitForSeconds(m_KeepTime);
|
| | | inBattleHint = false;
|
| | | m_BattleHintTween.gameObject.SetActive(false);
|
| | | isBattleHint = false;
|
| | | m_ContainerBattleHint.gameObject.SetActive(false);
|
| | | DisplayBattleHint();
|
| | | }
|
| | |
|
| | | IEnumerator Co_EvenKill()
|
| | | {
|
| | | yield return WaitingForSecondConst.GetWaitForSeconds(m_EvenKillTime);
|
| | | isEvenKill = false;
|
| | | m_ContainerEvenKill.gameObject.SetActive(false);
|
| | | DisplayEvenKill();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent;
|
| | | StageManager.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | | StartCoroutine(Co_Instance());
|
| | | }
|
| | |
|
| | | IEnumerator Co_Instance()
|
| | | {
|
| | | yield return null;
|
| | | var instance = BattleHint.Instance;
|
| | | }
|
| | |
|
| | | protected override void OnDestroy()
|
| | |
| | | private void OnStageLoadFinish()
|
| | | {
|
| | | ServerTipDetails.OnStageLoadFinish();
|
| | | BattleHint.Instance.OnStageLoadFinish();
|
| | | }
|
| | |
|
| | | private void BeforePlayerDataInitializeEvent()
|
| | |
| | | OnSysTipEvent(type[i], msg, tipInfoList);
|
| | | }
|
| | | break;
|
| | | case SysNotifyType.SysBattleHint:
|
| | | BattleHint.Instance.Receive(msg);
|
| | | case SysNotifyType.SysEvenKill:
|
| | | BattleHint.Instance.ReceiveEvenKill(msg, tipInfoList);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | SysTeamTip = 41,//队伍频道提示
|
| | | SysRealmTip = 100,//境界提示
|
| | | SysFixedTip1 = 11,//固定提示2
|
| | | SysBattleHint = 6,//上古战场提示
|
| | | SysEvenKill = 7,//上古战场连杀提示
|
| | | }
|
| | |
|
| | | public int Compare(SystemHintData x, SystemHintData y)
|
| | |
| | | if (m_DoubleToggle.isOn)
|
| | | {
|
| | | m_DoubleToggle.isOn = false;
|
| | | godBeastModel.IsToggleBool = false;
|
| | | }
|
| | | GodBeastReinforcementWin.ChooseToModify += ChooseToModify;
|
| | | godBeastModel.AbsorbEvent += AbsorbEvent;
|
| | |
| | |
|
| | | private void OnClickToggle(bool Isbool)
|
| | | {
|
| | | godBeastModel.IsToggleBool = Isbool;
|
| | | if (GodBeastNumber != 0 && GodBeastPart != 0)
|
| | | {
|
| | | AttributeAssignment();
|
| | |
| | | }
|
| | | if (m_DoubleToggle.isOn)//双倍强化
|
| | | {
|
| | | if (ListIndex.Count <= 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (NeedFairyJade <= 0)
|
| | | {
|
| | | dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 0);
|
| | | }
|
| | | else
|
| | | {
|
| | | int Gold = (int)UIHelper.GetMoneyCnt(1);//仙玉
|
| | | string strNull = string.Format(Language.Get("DogzDoubleRemind"), NeedFairyJade);
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), strNull, (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | if (Gold >= NeedFairyJade)
|
| | | {
|
| | | dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (VersionConfig.Get().isBanShu)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GoldErr");
|
| | | return;
|
| | | }
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | | DoubleStrength(ListIndex, ListCount); |
| | | }
|
| | | else//单倍强化
|
| | | {
|
| | | if (ListIndex.Count <= 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 0);
|
| | | SingleStrength(ListIndex, ListCount);//单倍强化
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | private void SingleStrength(List<int> ListIndex, List<int> ListCount)//单倍强化
|
| | | {
|
| | | if (ListIndex.Count <= 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (godBeastModel.IsNeedEquipment())
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("DogzStrengConfirm"), (bool isOk) => |
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 0);
|
| | | }
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 0);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private void DoubleStrength(List<int> ListIndex, List<int> ListCount)//双倍强化
|
| | | {
|
| | | if (ListIndex.Count <= 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (NeedFairyJade <= 0)//所需仙玉为0时
|
| | | {
|
| | | if (godBeastModel.IsNeedEquipment())
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("DogzStrengConfirm"), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 0);
|
| | | }
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 0);
|
| | | }
|
| | | }
|
| | | else//所需仙玉不为0时
|
| | | {
|
| | | int Gold = (int)UIHelper.GetMoneyCnt(1);//仙玉
|
| | | string strNull = string.Format(Language.Get("DogzDoubleRemind"), NeedFairyJade);
|
| | | if (godBeastModel.IsNeedEquipment())
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("DogzStrengConfirm"), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), strNull, (bool is_Ok) =>
|
| | | {
|
| | | if (is_Ok)
|
| | | {
|
| | | if (Gold >= NeedFairyJade)
|
| | | {
|
| | | dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (VersionConfig.Get().isBanShu)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GoldErr");
|
| | | return;
|
| | | }
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), strNull, (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | if (Gold >= NeedFairyJade)
|
| | | {
|
| | | dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (VersionConfig.Get().isBanShu)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GoldErr");
|
| | | return;
|
| | | }
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | |
| | | }
|
| | | private void ChooseToModify(int locationMarker)
|
| | | {
|
| | | GetGodBeastLocationMarker(locationMarker);
|
| | |
| | | if (IudetDogzEquipPlus != null)
|
| | | {
|
| | | SingleProficiency += IudetDogzEquipPlus[1];
|
| | | DoubleProficiency += itemModel.chinItemModel.EffectValueA1;
|
| | | DoubleProficiency += IudetDogzEquipPlus[1]+ itemModel.chinItemModel.EffectValueA1;
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | [SerializeField] GameObject m_Selectedbar_Image; |
| | | [SerializeField] Text m_Item_Text; |
| | | [SerializeField] Button m_GodBeastButton; |
| | | |
| | | [SerializeField] RedpointBehaviour m_RedPoint; |
| | | public Button GodBeastButton
|
| | | {
|
| | | get { return m_GodBeastButton; }
|
| | |
| | | } |
| | | |
| | | DogzModel Dogz_model;
|
| | | DogzModel dogz_model { get { return Dogz_model ?? (Dogz_model = ModelCenter.Instance.GetModel<DogzModel>()); } } |
| | | DogzModel dogz_model { get { return Dogz_model ?? (Dogz_model = ModelCenter.Instance.GetModel<DogzModel>()); } }
|
| | | GodBeastModel godBeastModel { get { return ModelCenter.Instance.GetModel<GodBeastModel>(); } }
|
| | | public void GetGodBeastLocationMarker(int locationMarker, int currentlySelected)
|
| | | {
|
| | | int godBeastNumber = locationMarker % 100;//神兽编号
|
| | |
| | | if (itemModel[i].EquipPlace == godBeastPart)
|
| | | {
|
| | | ItemCellModel ItemModel = new ItemCellModel(itemModel[i].itemId, true, 0, 0);//不显示绑定
|
| | | if (godBeastModel.GodBeastRedPointDic.ContainsKey(itemModel[i].itemInfo.ItemPlace))
|
| | | {
|
| | | m_RedPoint.redpointId = godBeastModel.GodBeastRedPointDic[(itemModel[i].itemInfo.ItemPlace)].id;
|
| | | }
|
| | | m_itemCell.Init(ItemModel);
|
| | | var itemConfig = Config.Instance.Get<ItemConfig>(itemModel[i].itemId);
|
| | | var IudetDogzEquipPlus = itemModel[i].GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
|
| | |
| | | DogzModel dogz_model { get { return Dogz_model ?? (Dogz_model = ModelCenter.Instance.GetModel<DogzModel>()); } }
|
| | | PlayerPackModel _playerPack;
|
| | | PlayerPackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); } }
|
| | | public Dictionary<int, Redpoint> GodBeastRedPointDic = new Dictionary<int, Redpoint>();//key装备位置下标(红点)
|
| | | private List<int> RedPointLIst = new List<int>();
|
| | | private const int Redpoint_key1 = 11202;//神兽强化红点
|
| | | public Redpoint redPointStre1 = new Redpoint(112, Redpoint_key1);
|
| | | public override void Init()
|
| | |
| | | playerPack.ItemCntReduceAct += ItemCntReduceAct;//物品数量减少
|
| | | dogz_model.UpdateAssistDogzEvent += UpdateAssistDogzEvent;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | | SetRedPointID();
|
| | | GodBeastRedPoint();
|
| | | }
|
| | |
|
| | |
| | |
|
| | | private void UpdateAssistDogzEvent()
|
| | | {
|
| | | SetRedPointID();
|
| | | GodBeastRedPoint();
|
| | | }
|
| | |
|
| | |
| | | return SiteEnhancementAttributeDic;
|
| | | }
|
| | |
|
| | | public int DogZBagIndex = 0;
|
| | | public int DogZBagIndex = 0;//当前强化的装备下标
|
| | | public bool IsToggleBool = false;
|
| | | public bool IsFullLevel()//是都满级能够继续吸收
|
| | | {
|
| | | bool IsBool = false;
|
| | | int DogZLV = 0;//获取当前神兽等级
|
| | | int DogProficiency = 0;//当前神兽的熟练度
|
| | | int SingleProficiency = 0;//单倍熟练度
|
| | |
| | | {
|
| | | return false;
|
| | | }
|
| | | int lv = QualityLimit[itemModel.chinItemModel.ItemColor];
|
| | | int lv = QualityLimit[itemModel.chinItemModel.ItemColor];//获取最大强化等级
|
| | | var DogzEquipMaxConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(itemModel.chinItemModel.EquipPlace, lv);
|
| | | var IudetDogzEquipPlus = itemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
|
| | |
|
| | |
| | | {
|
| | | DogZLV = IudetDogzEquipPlus[0];
|
| | | DogProficiency = IudetDogzEquipPlus[1];
|
| | | }
|
| | | if (DogZLV >= lv)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | foreach (var key in Absorption_Dic.Keys)
|
| | | {
|
| | |
| | | if (_IudetDogzEquipPlus != null)
|
| | | {
|
| | | SingleProficiency += _IudetDogzEquipPlus[1];
|
| | | DoubleProficiency += item_Model.chinItemModel.EffectValueA1;
|
| | | DoubleProficiency += item_Model.chinItemModel.EffectValueA1 + _IudetDogzEquipPlus[1];
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | if (true)
|
| | | if (IsToggleBool)//双倍熟练度
|
| | | {
|
| | | if (DogProficiency + DoubleProficiency >= DogzEquipMaxConfig.upExpTotal)
|
| | | {
|
| | | return true;
|
| | | return true;//已满
|
| | | }
|
| | | else
|
| | | {
|
| | | return false;
|
| | | return false;//未满
|
| | | }
|
| | | }
|
| | | else
|
| | | else//单倍熟练度
|
| | | {
|
| | | if (DogProficiency + SingleProficiency >= DogzEquipMaxConfig.upExpTotal)
|
| | | {
|
| | | return true;
|
| | | return true;//已满
|
| | | }
|
| | | else
|
| | | {
|
| | | return false;
|
| | | return false;//未满
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | private void SetRedPointID()//设置红点ID
|
| | | {
|
| | | GodBeastRedPointDic.Clear();
|
| | | RedPointLIst.Clear();
|
| | | var DogzEquipDict = dogz_model.dogzAssistStateDict;
|
| | | foreach (var key in DogzEquipDict.Keys)
|
| | | {
|
| | | if (DogzEquipDict[key] == 1)
|
| | | {
|
| | | List<ItemModel> itemModel = dogz_model.GetDogzEquips(key);
|
| | | for (int i = 0; i < itemModel.Count; i++)
|
| | | {
|
| | | int IndexId = itemModel[i].itemInfo.ItemPlace;
|
| | | int RedPoint = Redpoint_key1 * 1000 + IndexId;
|
| | | Redpoint redPointStare = new Redpoint(Redpoint_key1, RedPoint);
|
| | | if (!GodBeastRedPointDic.ContainsKey(IndexId))
|
| | | {
|
| | | GodBeastRedPointDic.Add(IndexId, redPointStare);
|
| | | RedPointLIst.Add(IndexId);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | RedPointLIst.Sort(Compare);
|
| | | }
|
| | | int Compare(int x, int y)
|
| | | {
|
| | | ItemModel IindexitemModelx = playerPack.GetItemModelByIndex(PackType.rptDogzEquip, x);
|
| | | ItemModel IindexitemModely = playerPack.GetItemModelByIndex(PackType.rptDogzEquip, y);
|
| | | if (IindexitemModelx.chinItemModel.ItemColor.CompareTo(IindexitemModely.chinItemModel.ItemColor) != 0)//品质
|
| | | {
|
| | | return -IindexitemModelx.chinItemModel.ItemColor.CompareTo(IindexitemModely.chinItemModel.ItemColor);
|
| | | }
|
| | | if (IindexitemModelx.chinItemModel.StarLevel.CompareTo(IindexitemModely.chinItemModel.StarLevel) != 0)//星级
|
| | | {
|
| | | return -IindexitemModelx.chinItemModel.StarLevel.CompareTo(IindexitemModely.chinItemModel.StarLevel);
|
| | | }
|
| | | if (IindexitemModelx.chinItemModel.EquipPlace.CompareTo(IindexitemModely.chinItemModel.EquipPlace) != 0)//装备位
|
| | | {
|
| | | return IindexitemModelx.chinItemModel.EquipPlace.CompareTo(IindexitemModely.chinItemModel.EquipPlace);
|
| | | }
|
| | | if (GetLV(IindexitemModelx).CompareTo(GetLV(IindexitemModely)) != 0)//强化等级
|
| | | {
|
| | | return -GetLV(IindexitemModelx).CompareTo(GetLV(IindexitemModely));
|
| | | }
|
| | | if (GetProficiency(IindexitemModelx).CompareTo(GetProficiency(IindexitemModely)) != 0)//熟练度
|
| | | {
|
| | | return -GetProficiency(IindexitemModelx).CompareTo(GetProficiency(IindexitemModely));
|
| | | }
|
| | | if (IindexitemModelx.equipScore.CompareTo(IindexitemModely.equipScore) != 0)//装备评分
|
| | | {
|
| | | return -IindexitemModelx.equipScore.CompareTo(IindexitemModely.equipScore);
|
| | | }
|
| | | return 1;
|
| | | }
|
| | |
|
| | | private int GetLV(ItemModel _ItemModel)
|
| | | {
|
| | | var IudetDogzEquipPlus = _ItemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
|
| | | if (IudetDogzEquipPlus != null)
|
| | | {
|
| | | return IudetDogzEquipPlus[0];
|
| | | }
|
| | | return 0;
|
| | | }
|
| | | private int GetProficiency(ItemModel _ItemModel)
|
| | | {
|
| | | var IudetDogzEquipPlus = _ItemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
|
| | | if (IudetDogzEquipPlus != null)
|
| | | {
|
| | | return IudetDogzEquipPlus[1];
|
| | | }
|
| | | return 0;
|
| | | }
|
| | | public int IndexId = 0;
|
| | | private void GodBeastRedPoint()//神兽强化红点
|
| | | {
|
| | | bool Istrue = false;
|
| | | bool IsRedPoint = false;
|
| | | int ItemColor = 10;
|
| | | var DogzEquipDict = dogz_model.dogzAssistStateDict;
|
| | | redPointStre1.state = RedPointState.None;
|
| | | IndexId = 0;
|
| | | foreach (var key in GodBeastRedPointDic.Keys)
|
| | | {
|
| | | GodBeastRedPointDic[key].state = RedPointState.None;
|
| | | }
|
| | | int Type = 0;
|
| | | foreach (var key in DogzEquipDict.Keys)
|
| | | {
|
| | |
| | | var itemModelBack = BackpackDic[keyBack];
|
| | | if (itemModelBack.chinItemModel.Type == 70)//有神兽水晶时的红点
|
| | | {
|
| | | redPointStre1.state = RedPointState.Simple;
|
| | | return;
|
| | | IsRedPoint = true;
|
| | | }
|
| | | if (itemModelBack.chinItemModel.ItemColor < _ItemColor)
|
| | | {
|
| | | _ItemColor = itemModelBack.chinItemModel.ItemColor;
|
| | | }
|
| | | }
|
| | | if (Type >= dogz_model.curSumAssistNum && ItemColor> _ItemColor)//出战神兽已满,且神兽背包有品质低于已助战神兽品质颜色时
|
| | | if (Type >= dogz_model.curSumAssistNum && ItemColor > _ItemColor)//出战神兽已满,且神兽背包有品质低于已助战神兽品质颜色时
|
| | | {
|
| | | redPointStre1.state = RedPointState.Simple;
|
| | | return;
|
| | | IsRedPoint = true;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (IsRedPoint)
|
| | | {
|
| | | int Lv = 100;
|
| | | for (int i = 0; i < RedPointLIst.Count; i++)
|
| | | {
|
| | | ItemModel _itemModel = playerPack.GetItemModelByIndex(PackType.rptDogzEquip, RedPointLIst[i]);
|
| | | var _IudetDogzEquipPlus = _itemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
|
| | | if (_IudetDogzEquipPlus != null)
|
| | | {
|
| | | if (_IudetDogzEquipPlus[0] < Lv)
|
| | | {
|
| | | IndexId = RedPointLIst[i];
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (0 < Lv)
|
| | | {
|
| | | Lv = 0;
|
| | | IndexId = RedPointLIst[i];
|
| | | }
|
| | | }
|
| | | }
|
| | | if (GodBeastRedPointDic.ContainsKey(IndexId))
|
| | | {
|
| | | GodBeastRedPointDic[IndexId].state = RedPointState.Simple;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public bool IsNeedEquipment()//是否有极品装备需要弹框
|
| | | {
|
| | | bool IsBool = false;
|
| | | foreach (var key in Absorption_Dic.Keys)
|
| | | {
|
| | | ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptDogzItem, key);
|
| | | if (itemModel != null)
|
| | | {
|
| | | if (itemModel.chinItemModel.EquipPlace > 0 && itemModel.chinItemModel.ItemColor >= 5)
|
| | | {
|
| | | IsBool = true;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | return IsBool;
|
| | | }
|
| | | } |
| | | |
| | |
| | | // [ Date ]: Thursday, August 16, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using EnhancedUI.EnhancedScroller;
|
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | |
| | | private List<GodBeastClass> GodBeastList = new List<GodBeastClass>(); |
| | | private int CurrentlySelected = 0; |
| | | private int JumpIndex = 0; |
| | | public int Offset = 0;//偏移量 |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | | {
|
| | | m_ScrollerController.OnRefreshCell += OnRefreshGridCell; |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | |
| | | {
|
| | | |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | {
|
| | | CurrentlySelected = 0;
|
| | | GetGodBeast();//获取神兽强化装备信息
|
| | | m_ScrollerController.OnRefreshCell += OnRefreshGridCell; |
| | | if (godBeastModel.ItemPlace != -1)
|
| | | |
| | | if (godBeastModel.ItemPlace != -1)//装备强化跳转选中
|
| | | {
|
| | | for (int i = 0; i < GodBeastList.Count; i++)
|
| | | {
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | if (GodBeastList.Count > 0)
|
| | |
|
| | | if (godBeastModel.redPointStre1.state == RedPointState.Simple)//强化红点选中
|
| | | {
|
| | | CurrentlySelected = GodBeastList[0].LocationMarker;
|
| | | GetDogZBagIndex();
|
| | | JumpIndex = 0; |
| | | for (int i = 0; i < GodBeastList.Count; i++)
|
| | | {
|
| | | if (GodBeastList[i].ItemPlace == godBeastModel.IndexId)
|
| | | {
|
| | | JumpIndex = i;
|
| | | CurrentlySelected = GodBeastList[i].LocationMarker;
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (GodBeastList.Count > 0)//默认选中个
|
| | | {
|
| | | CurrentlySelected = GodBeastList[0].LocationMarker;
|
| | | GetDogZBagIndex();
|
| | | JumpIndex = 0;
|
| | | }
|
| | | }
|
| | | } |
| | | OnCreateGridLineCell(m_ScrollerController);
|
| | | m_GodBeastSlidingList.Init(); |
| | | m_GodBeastAttributes.Init(); |
| | | m_GodBeastAttributes.GetGodBeastLocationMarker(CurrentlySelected);
|
| | | m_ScrollerController.JumpIndex(JumpIndex);
|
| | | |
| | |
|
| | |
|
| | |
|
| | | } |
| | | |
| | | protected override void OnActived()
|
| | | {
|
| | | var offset = 0f;
|
| | | m_ScrollerController.JumpIndex(JumpIndex,ref offset);
|
| | | m_ScrollerController.JumpIndex(Offset + offset, 0, EnhancedScroller.TweenType.immediate);
|
| | | } |
| | | protected override void OnAfterOpen() |
| | | { |
| | | playerPack.RefreshItemCountAct += RefreshItemCountAct;
|
| | |
| | | JumpIndex = 0;
|
| | | godBeastModel.ItemPlace = -1;
|
| | | playerPack.RefreshItemCountAct -= RefreshItemCountAct;
|
| | | m_ScrollerController.OnRefreshCell -= OnRefreshGridCell;
|
| | | DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent -= MakeItemAnswerEvent; |
| | | }
|
| | |
|
| | |
| | | public int Proficiency;//熟练度
|
| | | public int EquipScore;//装备评分
|
| | | public int Part;//装备位
|
| | | public int Count;//数量
|
| | | } |
| | | |
| | | public class GodBeastSlidingList : MonoBehaviour
|
| | |
| | | {
|
| | | m_ToggleAll.isOn = false;
|
| | | }
|
| | | GetGodBeastBag();
|
| | | FilterQuality();
|
| | | GetGodBeastBag();//获取神兽背包数据排序
|
| | | FilterQuality();//分类筛选
|
| | | godBeastModel.AbsorbEventUpdate();
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | });
|
| | |
| | | {
|
| | | m_ToggleAll.isOn = false;
|
| | | }
|
| | | GetGodBeastBag();
|
| | | FilterQuality();
|
| | | GetGodBeastBag();//获取神兽背包数据排序
|
| | | FilterQuality();//分类筛选
|
| | | godBeastModel.AbsorbEventUpdate();
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | });
|
| | |
| | | {
|
| | | m_ToggleAll.isOn = false;
|
| | | }
|
| | | GetGodBeastBag();
|
| | | FilterQuality();
|
| | | GetGodBeastBag();//获取神兽背包数据排序
|
| | | FilterQuality();//分类筛选
|
| | | godBeastModel.AbsorbEventUpdate();
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | });
|
| | |
| | | {
|
| | | m_ToggleAll.isOn = false;
|
| | | }
|
| | | GetGodBeastBag();
|
| | | FilterQuality();
|
| | | GetGodBeastBag();//获取神兽背包数据排序
|
| | | FilterQuality();//分类筛选
|
| | | godBeastModel.AbsorbEventUpdate();
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | });
|
| | |
| | | {
|
| | | m_ToggleAll.isOn = false;
|
| | | }
|
| | | GetGodBeastBag();
|
| | | FilterQuality();
|
| | | GetGodBeastBag();//获取神兽背包数据排序
|
| | | FilterQuality();//分类筛选
|
| | | godBeastModel.AbsorbEventUpdate();
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | });
|
| | |
| | | playerPack.ItemCntAddAct += RefreshItemCountAct;
|
| | | }
|
| | |
|
| | | |
| | |
|
| | |
|
| | | private void OnDisable()
|
| | | {
|
| | |
| | | playerPack.ItemCntAddAct -= RefreshItemCountAct;
|
| | | }
|
| | |
|
| | | |
| | |
|
| | |
|
| | | public void Init()
|
| | | {
|
| | |
| | | {
|
| | | if ((int)obj.MakeType == (int)MakeType.Def_mitDogzEquipPlus)
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | | }
|
| | | private void RefreshItemCountAct(PackType arg1, int arg2, int arg3)
|
| | |
| | | godBeastBagClass.Star = itemModel.chinItemModel.StarLevel;
|
| | | godBeastBagClass.EquipScore = itemModel.equipScore;
|
| | | godBeastBagClass.Part = itemModel.EquipPlace;
|
| | | godBeastBagClass.Count = itemModel.itemInfo.ItemCount;
|
| | | var IudetDogzEquipPlus = itemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
|
| | | if (IudetDogzEquipPlus == null)
|
| | | {
|
| | |
| | | {
|
| | | for (int k = 0; k < GodBeastBagList.Count; k++)
|
| | | {
|
| | | godBeastModel.Absorption_Dic.Add(GodBeastBagList[k].Index, 1);
|
| | | for (int j = 0; j < GodBeastBagList[k].Count; j++)
|
| | | {
|
| | | if (!godBeastModel.IsFullLevel())
|
| | | {
|
| | | if (!godBeastModel.Absorption_Dic.ContainsKey(GodBeastBagList[k].Index))
|
| | | {
|
| | | godBeastModel.Absorption_Dic.Add(GodBeastBagList[k].Index, 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | int Type = j + 1;
|
| | | godBeastModel.Absorption_Dic[GodBeastBagList[k].Index] = Type;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | return;
|
| | | } |
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | GodBeastChildNodes.GetGodBeastIndex(godBeastBagClass.Index);
|
| | | GodBeastChildNodes.ButtonDown.AddListener(() =>
|
| | | { |
| | | {
|
| | | if (itemModel.EquipPlace > 0)//选中的物品为装备
|
| | | {
|
| | | if (godBeastModel.Absorption_Dic.ContainsKey(godBeastBagClass.Index))
|
| | |
| | | public void RequestHighestEffect()
|
| | | {
|
| | | RecycleHighestEffect();
|
| | | Treasure _treasure;
|
| | | if (category == TreasureCategory.Human &&
|
| | | model.TryGetTreasure(treasureId, out _treasure) && _treasure.IsHighestStage
|
| | | && !model.GetTreasureFinishAnim(treasureId))
|
| | | {
|
| | | highestSfx = SFXPlayUtility.Instance.Play(5198, root);
|
| | | if (highestSfx != null)
|
| | | {
|
| | | highestSfx.duration = 0;
|
| | | LayerUtility.SetLayer(highestSfx.gameObject, LayerUtility.UILayer, true);
|
| | | highestSfx.transform.localPosition = Vector3.zero;
|
| | | highestSfx.transform.LookAt(UI3DTreasureSelectStage.Instance.center);
|
| | | }
|
| | | }
|
| | | //Treasure _treasure;
|
| | | //if (category == TreasureCategory.Human &&
|
| | | // model.TryGetTreasure(treasureId, out _treasure) && _treasure.IsHighestStage
|
| | | // && !model.GetTreasureFinishAnim(treasureId))
|
| | | //{
|
| | | // highestSfx = SFXPlayUtility.Instance.Play(5198, root);
|
| | | // if (highestSfx != null)
|
| | | // {
|
| | | // highestSfx.duration = 0;
|
| | | // LayerUtility.SetLayer(highestSfx.gameObject, LayerUtility.UILayer, true);
|
| | | // highestSfx.transform.localPosition = Vector3.zero;
|
| | | // highestSfx.transform.LookAt(UI3DTreasureSelectStage.Instance.center);
|
| | | // }
|
| | | //}
|
| | | }
|
| | |
|
| | | public void RecycleHighestEffect()
|
| | |
| | |
|
| | | public bool GetTreasureFinishAnim(int _treasureId)
|
| | | {
|
| | | if (_treasureId == 101)
|
| | | {
|
| | | //if (_treasureId == 101)
|
| | | //{
|
| | | return false;
|
| | | }
|
| | | var list = GetTreasureCategory(TreasureCategory.Human);
|
| | | var index = list.IndexOf(_treasureId);
|
| | | if (index == -1)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | uint value = 0;
|
| | | uint.TryParse(QuickSetting.Instance.GetQuickSetting(QuickSetting.QuickSettingType.TreasureHighestAnim, 0), out value);
|
| | | return MathUtility.GetBitValue(value, (ushort)index);
|
| | | //}
|
| | | //var list = GetTreasureCategory(TreasureCategory.Human);
|
| | | //var index = list.IndexOf(_treasureId);
|
| | | //if (index == -1)
|
| | | //{
|
| | | // return false;
|
| | | //}
|
| | | //uint value = 0;
|
| | | //uint.TryParse(QuickSetting.Instance.GetQuickSetting(QuickSetting.QuickSettingType.TreasureHighestAnim, 0), out value);
|
| | | //return MathUtility.GetBitValue(value, (ushort)index);
|
| | | }
|
| | |
|
| | | public void SetTreasureFinishAnim(int _treasureId, bool anim = true)
|
| | | {
|
| | | var list = GetTreasureCategory(TreasureCategory.Human);
|
| | | var index = list.IndexOf(_treasureId);
|
| | | if (index == -1)
|
| | | {
|
| | | return;
|
| | | }
|
| | | uint value = 0;
|
| | | uint.TryParse(QuickSetting.Instance.GetQuickSetting(QuickSetting.QuickSettingType.TreasureHighestAnim, 0), out value);
|
| | | int bitValue = MathUtility.SetBitValue((int)value, (ushort)index, anim);
|
| | | QuickSetting.Instance.SetQuickSetting(QuickSetting.QuickSettingType.TreasureHighestAnim, bitValue);
|
| | | QuickSetting.Instance.SendPackage();
|
| | | //var list = GetTreasureCategory(TreasureCategory.Human);
|
| | | //var index = list.IndexOf(_treasureId);
|
| | | //if (index == -1)
|
| | | //{
|
| | | // return;
|
| | | //}
|
| | | //uint value = 0;
|
| | | //uint.TryParse(QuickSetting.Instance.GetQuickSetting(QuickSetting.QuickSettingType.TreasureHighestAnim, 0), out value);
|
| | | //int bitValue = MathUtility.SetBitValue((int)value, (ushort)index, anim);
|
| | | //QuickSetting.Instance.SetQuickSetting(QuickSetting.QuickSettingType.TreasureHighestAnim, bitValue);
|
| | | //QuickSetting.Instance.SendPackage();
|
| | | }
|
| | |
|
| | | public bool TryGetUnlockShowTreasure(out int _id)
|
| | |
| | | private WindowSearchConfig _tagWinSearchModel;
|
| | | private FuncOpenLVConfig _tagOpenLvModel;
|
| | | private Dictionary<int, List<string>> openWindows = new Dictionary<int, List<string>>();
|
| | | private Dictionary<int, string> jumpWinNameDict = new Dictionary<int, string>();
|
| | | public Dictionary<int, string> jumpWinNameDict = new Dictionary<int, string>();
|
| | | PlayerPetDatas m_petModel;
|
| | | PlayerPetDatas petmodel
|
| | | {
|
| | |
| | | private void SetJumpLogic<T>(int _functionalOrder = 0, bool _forceSync = true) where T : Window
|
| | | {
|
| | | string curOpenWin = typeof(T).Name;
|
| | | jumpWinNameDict.Add(jumpPhase, curOpenWin);
|
| | | if(jumpWinNameDict.ContainsKey(jumpPhase - 1))
|
| | | {
|
| | | if(jumpWinNameDict[jumpPhase - 1] != curOpenWin)
|
| | | {
|
| | | jumpWinNameDict.Add(jumpPhase, curOpenWin);
|
| | | }
|
| | | else
|
| | | {
|
| | | openWindows[jumpPhase].Clear();
|
| | | jumpPhase -= 1;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | jumpWinNameDict.Add(jumpPhase, curOpenWin);
|
| | | }
|
| | | |
| | | jumpType = _tagWinSearchModel.Type;
|
| | | switch (_tagWinSearchModel.Type)
|
| | | {
|