Merge branch 'Cross_Server' of http://192.168.0.87:10010/r/snxxz_scripts into Cross_Server
| | |
| | | {
|
| | | case AttackFailType.SkillFail_AtkInterval:
|
| | | case AttackFailType.SkillFail_CD:
|
| | | UnityEditor.EditorUtility.DisplayDialog("警告", "技能释放失败, 可以的话截图封包, 过滤填写 B405 0614 B403 . 发给黑二 .", "好的");
|
| | | //UnityEditor.EditorUtility.DisplayDialog("警告", "技能释放失败, 可以的话截图封包, 过滤填写 B405 0614 B403 . 发给黑二 .", "好的");
|
| | | break;
|
| | | }
|
| | |
|
| | |
| | | protected GActorFight DecideAttackTarget(Vector3 searchCenter, float range, int lockNpcID = -1)
|
| | | {
|
| | | GA_Hero _hero = PlayerDatas.Instance.hero;
|
| | | GActorFight _target = _hero.LockTarget as GActorFight;
|
| | | GActorFight _target = _hero.SelectTarget as GActorFight;
|
| | |
|
| | | if (_target == null || !_target.CanAtked() || _target.ActorInfo.serverDie)
|
| | | {
|
| | | _target = GAMgr.Instance.FindAtkTarget(searchCenter, range, 360, lockNpcID);
|
| | | }
|
| | |
|
| | | if (_target != null && lockNpcID != -1)
|
| | | {
|
| | | var _npcFight = _target as GActorNpcFight;
|
| | | if(_npcFight != null)
|
| | | {
|
| | | if(_npcFight.NpcConfig.NPCID != lockNpcID)
|
| | | {
|
| | | _target = GAMgr.Instance.FindAtkTarget(searchCenter, range, 360, lockNpcID);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | return _target;
|
| | | }
|
| | |
|
| | |
| | | var _dungeonModel = ModelCenter.Instance.GetModel<DungeonModel>();
|
| | | _dungeonModel.updateMissionEvent += UpdateMissionEvent;
|
| | |
|
| | | m_HandupRange = 10;
|
| | | m_HandupRange = 50;
|
| | | }
|
| | |
|
| | | private void UpdateMissionEvent()
|
| | |
| | |
|
| | | if (randomNpcID.Count > 0)
|
| | | {
|
| | | m_LockTargetNpcID = randomNpcID[Random.Range(0, randomNpcID.Count - 1)];
|
| | | var _result = randomNpcID[Random.Range(0, randomNpcID.Count - 1)];
|
| | | if (m_LockTargetNpcID != _result)
|
| | | {
|
| | | m_LockTargetNpcID = _result;
|
| | | Debug.LogFormat("替换锁定的任务NPC: {0}", m_LockTargetNpcID);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (_hero.LockTarget != null)
|
| | | if (_hero.LockTarget != null && !(_hero.LockTarget is GA_NpcCollect))
|
| | | {
|
| | | // 判断是否要清空锁定目标
|
| | | DoIfClearLockTarget();
|
| | |
| | |
|
| | | var _chkDis = reFindSelectTargetDist;
|
| | |
|
| | | if (_hero.SelectTarget is GA_NpcCollect && PlayerDatas.Instance.baseData.MapID == 31340)
|
| | | if (PlayerDatas.Instance.baseData.MapID == 31340 && _hero.SelectTarget is GA_NpcCollect)
|
| | | {
|
| | | _chkDis = reFindSelectTargetDist * 2;
|
| | | _chkDis += 1;
|
| | | }
|
| | |
|
| | | if (_distSqrt > Mathf.Pow(reFindSelectTargetDist, _chkDis))
|
| | |
| | | _hero.LockTarget = GAMgr.Instance.GetBySID(_bestTargetID);
|
| | | _hero.SelectTarget = _hero.LockTarget;
|
| | | m_SelectedTarget.Add(_bestTargetID);
|
| | | if (_hero.LockTarget != null)
|
| | | {
|
| | | GA_Hero.CallLockTargetChanged(_hero.LockTarget.ServerInstID);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | /// 当切换锁定目标的时候, 为空的时候id=0
|
| | | /// </summary>
|
| | | public static event UnityAction<uint> OnLockTargetChanged;
|
| | | public static void CallLockTargetChanged(uint sid)
|
| | | {
|
| | | if (OnLockTargetChanged != null)
|
| | | {
|
| | | OnLockTargetChanged(sid);
|
| | | }
|
| | | }
|
| | |
|
| | | public static event UnityAction<uint, string> OnKillPlayer;
|
| | |
|
| | | private GameObject m_Light;
|
| | |
| | | return;
|
| | | }
|
| | | m_LockTarget = value;
|
| | |
|
| | | if (OnLockTargetChanged != null)
|
| | | {
|
| | | if (m_LockTarget != null)
|
| | | {
|
| | | OnLockTargetChanged(m_LockTarget.ServerInstID);
|
| | | }
|
| | | else
|
| | | {
|
| | | OnLockTargetChanged(0);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | IOtherSelectable _selectable = base.SelectTarget as IOtherSelectable;
|
| | | if (_selectable != null)
|
| | | {
|
| | |
| | | {
|
| | | var _dist = MathUtility.DistanceSqrtXZ(_collect.Pos, Pos);
|
| | |
|
| | | if (_dist < 16)
|
| | | if (_dist < 6)
|
| | | {
|
| | | if ((SelectTarget == null || SelectTarget is GA_NpcCollect) && SelectTarget != _collect)
|
| | | {
|
| | |
| | | {
|
| | | if (NpcConfig.NPCID == 33409001)
|
| | | {
|
| | | m_Model.transform.localPosition = new Vector3(0,0.132f,0);
|
| | | m_Model.transform.localPosition = new Vector3(0, 0.132f, 0);
|
| | | }
|
| | | else if (NpcConfig.NPCID == 33409002)
|
| | | {
|
| | | m_Model.transform.localPosition = new Vector3(0,0.142f,0);
|
| | | m_Model.transform.localPosition = new Vector3(0, 0.142f, 0);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | public override void OnUnSelect()
|
| | | {
|
| | | base.OnUnSelect();
|
| | |
|
| | | if (m_ArrivedList.Contains(ServerInstID))
|
| | | {
|
| | | if (OnLeave != null)
|
| | |
| | | // 设置锁定目标为此对象
|
| | | _hero.LockTarget = this;
|
| | | _hero.SelectTarget = this;
|
| | | GA_Hero.CallLockTargetChanged(ServerInstID);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | else |
| | | { |
| | | var surplusSeconds = Mathf.RoundToInt(CrossServerLogin.Instance.oneVsOnePlayerData.autoEnsureTime - Time.time); |
| | | m_CountDown.text = string.Format("{0}秒后进入", surplusSeconds); |
| | | m_CountDown.text = Language.Get("CrossMatchingSuccess2", surplusSeconds); |
| | | } |
| | | |
| | | } |
| | |
| | |
|
| | | public bool IsMatching { get; set;}
|
| | | public DateTime matchStartTime { get; set; }
|
| | |
|
| | | public DateTime roundEndTime { get; private set; }
|
| | | public override void Init()
|
| | | {
|
| | | IsMatching = false;
|
| | |
| | | var mission = dungeonModel.mission;
|
| | | if(mission.prepareTime > 0)
|
| | | {
|
| | | if(!WindowCenter.Instance.IsOpen<CrossServerOneVsOneRoundWin>())
|
| | | roundEndTime = DateTime.Now + new TimeSpan(mission.prepareTime * TimeSpan.TicksPerMillisecond);
|
| | | if (!WindowCenter.Instance.IsOpen<CrossServerOneVsOneRoundWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<CrossServerOneVsOneRoundWin>();
|
| | | }
|
| | |
| | | using UnityEngine;
|
| | | using System;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | |
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | GlobalTimeEvent.Instance.secondEvent += UpdateCoolTime;
|
| | | SetDisplay();
|
| | | }
|
| | | protected override void OnAfterOpen()
|
| | |
| | |
|
| | | }
|
| | |
|
| | | protected override void LateUpdate()
|
| | | {
|
| | | base.LateUpdate();
|
| | | UpdateCoolTime();
|
| | | |
| | | }
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | GlobalTimeEvent.Instance.secondEvent -= UpdateCoolTime;
|
| | | |
| | | }
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | |
| | | private void SetDisplay()
|
| | | {
|
| | | int roundNum = dungeonModel.mission.roundNum;
|
| | | coolTime = dungeonModel.mission.prepareTime / 1000;
|
| | | coolTime = -1;
|
| | | bool isWin = IsWin();
|
| | | victoryObj.SetActive(isWin);
|
| | | failureObj.SetActive(!isWin);
|
| | |
| | |
|
| | | private void UpdateCoolTime()
|
| | | {
|
| | | coolTimeText.text = coolTime.ToString();
|
| | | coolTime -= 1;
|
| | | if(coolTime <= 0)
|
| | | if (crossServerModel.roundEndTime > DateTime.Now)
|
| | | {
|
| | | var surplusTime = Mathf.Clamp((int)(crossServerModel.roundEndTime - DateTime.Now).TotalSeconds, 0, int.MaxValue);
|
| | | if (coolTime != surplusTime)
|
| | | {
|
| | | coolTime = surplusTime;
|
| | | coolTimeText.text = coolTime.ToString();
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | CloseImmediately();
|
| | | coolTime = 0;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<DungeonModel>()); |
| | | } |
| | | } |
| | | |
| | | bool isEndWait = false; |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | isEndWait = false; |
| | | beginTime = model.GetCoolDownEndTime(DungeonCoolDownType.WaitPlayer); |
| | | model.dungeonCoolDownEvent += OnBeginTimeEvent; |
| | | } |
| | |
| | | private void OnBeginTimeEvent(DungeonCoolDownType _type) |
| | | { |
| | | if (_type != DungeonCoolDownType.WaitPlayer) |
| | | {
|
| | | if (m_CoolDownContainer.gameObject.activeInHierarchy) |
| | | { |
| | | m_CoolDownContainer.gameObject.SetActive(false); |
| | | } |
| | | { |
| | | isEndWait = true; |
| | | return; |
| | | } |
| | | |
| | |
| | | { |
| | | base.LateUpdate(); |
| | | |
| | | if (beginTime > DateTime.Now) |
| | | if (beginTime > DateTime.Now && !isEndWait) |
| | | { |
| | | var surplusTime = Mathf.Clamp((int)(beginTime - DateTime.Now).TotalSeconds,0,int.MaxValue); |
| | | m_CoolDown.text = Language.Get("CrossServer120", surplusTime); |
| | |
| | | }
|
| | | private void UpdatePkResultEvent()
|
| | | {
|
| | | if (IsCrossServer())//副本结算界面
|
| | | if (IsCrossServerOneVsOne())//副本结算界面
|
| | | {
|
| | | WindowCenter.Instance.Open<CrossServerSettlementWin>();
|
| | | }
|
| | |
| | | GameNetSystem.Instance.SendInfo(c103);
|
| | | }
|
| | |
|
| | | public static bool IsCrossServer()//是否再跨服副本中
|
| | | public static bool IsCrossServerOneVsOne()//是否再跨服副本中
|
| | | {
|
| | | bool _bool = false;
|
| | | int mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | if (mapId == 32010 || mapId == 32011)
|
| | | {
|
| | | _bool = true;
|
| | | }
|
| | | return _bool;
|
| | | return mapId == 32010 || mapId == 32011;
|
| | | }
|
| | |
|
| | | public void ViewCrossPKBillboard(int ZoneID, int SeasonID)//(赛区,赛季) 查看跨服竞技场赛季排行榜
|
| | |
| | | [SerializeField] Button m_QuestionRank;
|
| | | [SerializeField] Text m_QuestionRankBtnTxt;
|
| | | [SerializeField] DungeonTargetBehaviour m_TargetBehaviour;
|
| | | [SerializeField] RectTransform m_ContainerHint;
|
| | | [SerializeField] RectTransform m_ContainerRank;
|
| | | [SerializeField] FairyFeastRankBehaviour[] m_RankBehaviours;
|
| | | [SerializeField] FairyFeastRankBehaviour m_TopRank;
|
| | |
| | | m_QuestionRankBtnTxt.color = _index == 0 ? m_SelectEffect.unSelectTextColor : m_SelectEffect.selectTextColor;
|
| | |
|
| | | m_TargetBehaviour.gameObject.SetActive(_index == 0);
|
| | | m_ContainerHint.gameObject.SetActive(_index == 0);
|
| | | m_ContainerRank.gameObject.SetActive(_index == 1);
|
| | | currentSelect = _index;
|
| | | if (_index == 0)
|
| | |
| | | m_Liquid.gameObject.SetActive(false);
|
| | | var dataMapId = model.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID);
|
| | | m_ExitDungeon.gameObject.SetActive(dataMapId != DemonJarModel.DEMONJAR_MAPID
|
| | | && !CrossServerRewardModel.IsCrossServer());
|
| | | && !CrossServerRewardModel.IsCrossServerOneVsOne());
|
| | | m_ContainerAncient.gameObject.SetActive(dataMapId == 31160);
|
| | | m_BossInfosContainer.gameObject.SetActive(dataMapId == ElderGodAreaModel.ELDERGODAREA_MAPID || dataMapId == BossHomeModel.BOSSHOME_MAPID);
|
| | | m_GatherSoulDungeonBehaviour.gameObject.SetActive(dataMapId == GatherSoulDungeonModel.DUNGEON_MAPID);
|
| | |
| | |
|
| | | static void OnShowBossLifeBar(uint _instanceId, int _npcId, bool _show)
|
| | | {
|
| | | if (CrossServerRewardModel.IsCrossServerOneVsOne() && _show)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var dataMapId = ModelCenter.Instance.GetModel<DungeonModel>().GetDataMapIdByMapId(mapId);
|
| | | if (dataMapId == DemonJarModel.DEMONJAR_MAPID)
|
| | |
| | |
|
| | | static void OnRefreshBossLifeBar(uint _instanceId, int _npcId, ulong _hp, ulong _maxHp)
|
| | | {
|
| | | if (CrossServerRewardModel.IsCrossServerOneVsOne())
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var dataMapId = ModelCenter.Instance.GetModel<DungeonModel>().GetDataMapIdByMapId(mapId);
|
| | | if (dataMapId == DemonJarModel.DEMONJAR_MAPID)
|
| | |
| | |
|
| | | static void OnShowPlayerLifeBar(uint _instanceId, bool _show)
|
| | | {
|
| | | if (CrossServerRewardModel.IsCrossServerOneVsOne() && _show)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | TargetBriefInfoWin win;
|
| | | if (!WindowCenter.Instance.IsOpen<TargetBriefInfoWin>())
|
| | | {
|
| | |
| | |
|
| | | static void OnRefreshPlayerLifeBar(uint _instanceId, ulong _hp, ulong _maxHp)
|
| | | {
|
| | | if (CrossServerRewardModel.IsCrossServerOneVsOne())
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | var win = WindowCenter.Instance.Get<TargetBriefInfoWin>();
|
| | | if (win != null)
|
| | | {
|
| | |
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | m_ContainerBoss.gameObject.SetActive(false);
|
| | | m_ContainerPlayer.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | | Language.Get(propertyCountNameKey), Language.Get("SoulCategoryProperty"));
|
| | | break;
|
| | | case 2:
|
| | | m_CategoryName.text = StringUtility.Contact(Language.Get(qualityNameKey),
|
| | | m_CategoryName.text = StringUtility.Contact(Language.Get(qualityNameKey), Language.Get(propertyCountNameKey),
|
| | | Language.Get("ComposeSoulCore"));
|
| | | break;
|
| | | case 3:
|
| | |
| | | continue;
|
| | | }
|
| | | var propertyCount = gatherSoulConfig.AttrType.Length;
|
| | | if (itemConfig.Type == GatheringSoulModel.GATHERSOUL_CORE_TYPE)
|
| | | {
|
| | | propertyCount = 0;
|
| | | }
|
| | | var quality = itemConfig.ItemColor;
|
| | | var category = new ComposeCategory()
|
| | | {
|
| | |
| | | soulModel.gatherSoulPackRefresh += GatherSoulPackRefresh;
|
| | | soulModel.gatherSoulHolesRefresh += GatherSoulHolesRefresh;
|
| | | DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent += MakeItemAnswerEvent;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | | soulModel.gatherSoulPackRefresh -= GatherSoulPackRefresh;
|
| | | soulModel.gatherSoulHolesRefresh -= GatherSoulHolesRefresh;
|
| | | DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent -= MakeItemAnswerEvent;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= PlayerDataRefreshInfoEvent;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void PlayerDataRefreshInfoEvent(PlayerDataRefresh refreshType)
|
| | | {
|
| | | if (refreshType == PlayerDataRefresh.LV)
|
| | | {
|
| | | DisplayRequireLevel();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | m_RequireLevel.gameObject.SetActive(true);
|
| | | m_RequireLevel.text = Language.Get("GatherSoulComposeRequireLevel", compose.requireLevel);
|
| | | m_RequireLevel.color = UIHelper.GetUIColor(PlayerDatas.Instance.baseData.LV >= compose.requireLevel ?
|
| | | TextColType.NavyBrown : TextColType.Red, true);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | get { return ModelCenter.Instance.GetModel<GatherSoulComposeModel>(); }
|
| | | }
|
| | |
|
| | | bool existItem = false;
|
| | |
|
| | | private void Awake()
|
| | | {
|
| | | m_Func.onClick.AddListener(OnFunc);
|
| | |
| | | m_ContainreItem.gameObject.SetActive(equiped);
|
| | | m_ContainerLock.gameObject.SetActive(!unlockHole);
|
| | | m_ContainerEquipSign.gameObject.SetActive(!equiped && unlockHole);
|
| | | existItem = equiped;
|
| | | if (equiped)
|
| | | {
|
| | | var config = Config.Instance.Get<ItemConfig>(item.id);
|
| | |
| | | {
|
| | | if (this.hole == hole)
|
| | | {
|
| | | bool exist = existItem;
|
| | | DisplayBase();
|
| | | if (!exist && existItem && model.serverInited)
|
| | | {
|
| | | EffectMgr.Instance.PlayUIEffect(3079, 2100, transform, false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | [SerializeField] Text m_Count;
|
| | | [SerializeField] Button m_Func;
|
| | | [SerializeField] RectTransform m_Select;
|
| | | [SerializeField] UIEffect m_Effect;
|
| | |
|
| | | VirtualPackModel model
|
| | | {
|
| | |
| | |
|
| | | VirtualItem displayItem;
|
| | |
|
| | | bool requireResolveEffect = false;
|
| | |
|
| | | public static event Action<Transform> alreadyResolveEvent;
|
| | |
|
| | | private void Awake()
|
| | | {
|
| | | if (m_Func != null)
|
| | | {
|
| | | m_Func.onClick.AddListener(OnFunc);
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnEnable()
|
| | | {
|
| | | soulModel.prepareResolveEvent += PrepareResolveEvent;
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent;
|
| | | DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent += MakeItemAnswerEvent;
|
| | | }
|
| | |
|
| | | private void OnDisable()
|
| | | {
|
| | | soulModel.prepareResolveEvent -= PrepareResolveEvent;
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= BeforePlayerDataInitializeEvent;
|
| | | DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent -= MakeItemAnswerEvent;
|
| | | requireResolveEffect = false;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | {
|
| | | if (m_Select != null)
|
| | | {
|
| | | m_Select.gameObject.SetActive(displayItem.packType == PackType.rptGatherSoul
|
| | | && soulModel.replaceRedpoint.state == RedPointState.Simple
|
| | | && soulModel.replaceRedpointIndex == displayItem.index);
|
| | | var requireSelect = displayItem.packType == PackType.rptGatherSoul
|
| | | && soulModel.topBestSoulIndexs.Contains(displayItem.index);
|
| | | m_Select.gameObject.SetActive(requireSelect);
|
| | | if (requireSelect)
|
| | | {
|
| | | if (m_Effect.target != null)
|
| | | {
|
| | | var animator = m_Effect.target.GetAnimator();
|
| | | if (animator != null)
|
| | | {
|
| | | animator.Play(0, 0, GatherSoulWin.sync_topsoul_normalized);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void PrepareResolveEvent(PackType packType, int index)
|
| | | {
|
| | | if (displayItem.packType == packType && displayItem.index == index)
|
| | | {
|
| | | requireResolveEffect = true;
|
| | | }
|
| | | }
|
| | |
|
| | | private void BeforePlayerDataInitializeEvent()
|
| | | {
|
| | | requireResolveEffect = false;
|
| | | }
|
| | |
|
| | | private void MakeItemAnswerEvent(H0721_tagMakeItemAnswer package)
|
| | | {
|
| | | if (package.MakeType == (int)MakeType.Def_mitGatherSoulDecompose)
|
| | | {
|
| | | if (requireResolveEffect)
|
| | | {
|
| | | if (alreadyResolveEvent != null)
|
| | | {
|
| | | alreadyResolveEvent(transform);
|
| | | }
|
| | | requireResolveEffect = false;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | if (composeModel.TryGetCompose(item.id, out compose)
|
| | | && compose.requireItems.Count > 0)
|
| | | {
|
| | | data.SetTipsFuncBtn(ItemWinBtnType.split, OnTipFunc);
|
| | | data.SetTipsFuncBtn(ItemWinBtnType.dismantle, OnTipFunc);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | {
|
| | | data.SetTipsFuncBtn(ItemWinBtnType.compose, OnTipFunc);
|
| | | }
|
| | | if (soulModel.IsSamePropertyCompareHoles(-1, item as GatherSoulItem) == -1)
|
| | | bool existSamePropertyHole = soulModel.IsSamePropertyCompareHoles(-1, item as GatherSoulItem) != -1;
|
| | | bool existCoreHoleItem = false;
|
| | | GatherSoulItem holeItem;
|
| | | if (soulModel.TryGetItem(soulModel.coreHole, out holeItem))
|
| | | {
|
| | | data.SetTipsFuncBtn(ItemWinBtnType.Wear, OnTipFunc);
|
| | | existCoreHoleItem = true;
|
| | | }
|
| | | if (item.itemType == GatheringSoulModel.GATHERSOUL_CORE_TYPE)
|
| | | {
|
| | | data.SetTipsFuncBtn(existCoreHoleItem ? ItemWinBtnType.Replace : ItemWinBtnType.Wear, OnTipFunc);
|
| | | }
|
| | | else
|
| | | {
|
| | | data.SetTipsFuncBtn(ItemWinBtnType.Replace, OnTipFunc);
|
| | | data.SetTipsFuncBtn(existSamePropertyHole ? ItemWinBtnType.Replace : ItemWinBtnType.Wear, OnTipFunc);
|
| | | }
|
| | | }
|
| | | itemTipsModel.SetItemTipsModel(data);
|
| | |
| | |
|
| | | public static int selectHole = 0;
|
| | |
|
| | | int level = 0;
|
| | |
|
| | | GatheringSoulModel model
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<GatheringSoulModel>(); }
|
| | |
| | | m_ItemName.color = UIHelper.GetUIColor(itemConfig.ItemColor);
|
| | | m_Level.text = Language.Get("Z1024", item.level);
|
| | | m_Icon.SetSprite(itemConfig.IconKey);
|
| | | level = item.level;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | CloseImmediately();
|
| | | return;
|
| | | }
|
| | | var record = level;
|
| | | Display();
|
| | | if (level > record && model.serverInited)
|
| | | {
|
| | | EffectMgr.Instance.PlayUIEffect(3078, 3100, m_Icon.transform, false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | selectQuality = GetDefaultQuality();
|
| | | m_QualitySort.SetDefault();
|
| | | m_Quality.text = Language.Get(StringUtility.Contact("GatherSoulResolve_", selectQuality));
|
| | | m_Quality.color = UIHelper.GetUIColor(selectQuality);
|
| | | Display();
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent;
|
| | | model.gatherSoulPackRefresh += GatherSoulPackRefresh;
|
| | | m_QualitySort.onSelectSortEvent += OnSelectSort;
|
| | | model.oneKeyResolveRefresh += OneKeyResolveRefresh;
|
| | | DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent += MakeItemAnswerEvent;
|
| | | m_ScrollerControl.JumpIndex(0);
|
| | | }
|
| | |
|
| | |
| | | model.gatherSoulPackRefresh -= GatherSoulPackRefresh;
|
| | | m_QualitySort.onSelectSortEvent -= OnSelectSort;
|
| | | model.oneKeyResolveRefresh -= OneKeyResolveRefresh;
|
| | | DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent -= MakeItemAnswerEvent;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | |
|
| | | int GetDefaultQuality()
|
| | | {
|
| | | for (int i = 2; i < 5; i++)
|
| | | for (int i = 4; i >= 2; i--)
|
| | | {
|
| | | model.GetResolveSouls(i, model.resolveItems);
|
| | | if (model.resolveItems.Count > 0)
|
| | |
| | | resolveCell.Display(cell.index);
|
| | | }
|
| | |
|
| | | private void MakeItemAnswerEvent(H0721_tagMakeItemAnswer package)
|
| | | {
|
| | | if (package.MakeType == (int)MakeType.Def_mitGatherSoulDecompose)
|
| | | {
|
| | | EffectMgr.Instance.PlayUIEffect(3080, 3100, transform, false);
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnSelectSort(SortType type, int sort)
|
| | | {
|
| | | if (type == SortType.EquipQuality)
|
| | | {
|
| | | selectQuality = sort;
|
| | | Display();
|
| | | m_Quality.color = UIHelper.GetUIColor(selectQuality);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | [SerializeField] Text m_ItemName;
|
| | | [SerializeField] RectTransform m_ContainerEssence;
|
| | | [SerializeField] RectTransform m_ContainerSoul;
|
| | | [SerializeField] RectTransform m_ContainerLevel;
|
| | | [SerializeField] RectTransform m_ContainerItem;
|
| | | [SerializeField] Image m_ItemIcon;
|
| | | [SerializeField] Text m_ItemLevel;
|
| | |
| | | m_ContainerSoul.gameObject.SetActive(!isSoulEssence);
|
| | | m_ContainerEssence.gameObject.SetActive(isSoulEssence);
|
| | | m_ItemLevel.gameObject.SetActive(!isSoulEssence);
|
| | | m_ContainerLevel.gameObject.SetActive(!isSoulEssence);
|
| | | if (!isSoulEssence)
|
| | | {
|
| | | m_ItemLevel.text = level.ToString();
|
| | |
| | | m_Propertys[index].gameObject.SetActive(true);
|
| | | m_Propertys[index].DisplayUpper(propertySorts[i], displayPropertyDict[propertySorts[i]]);
|
| | | }
|
| | | else if (index < m_ClonePropertys.Count)
|
| | | else if (index - m_Propertys.Length < m_ClonePropertys.Count)
|
| | | {
|
| | | m_ClonePropertys[index].gameObject.SetActive(true);
|
| | | m_ClonePropertys[index].DisplayUpper(propertySorts[i], displayPropertyDict[propertySorts[i]]);
|
| | | m_ClonePropertys[index - m_Propertys.Length].gameObject.SetActive(true);
|
| | | m_ClonePropertys[index - m_Propertys.Length].DisplayUpper(propertySorts[i], displayPropertyDict[propertySorts[i]]);
|
| | | }
|
| | | index++;
|
| | | }
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | var behaviour = GameObject.Instantiate(m_Propertys[0]);
|
| | | if (behaviour != null)
|
| | | var count = propertySorts.Count - m_Propertys.Length - m_ClonePropertys.Count;
|
| | | for (int i = 0; i < count; i++)
|
| | | {
|
| | | behaviour.transform.SetParent(m_Content);
|
| | | behaviour.transform.localPosition = Vector3.zero;
|
| | | behaviour.transform.localEulerAngles = Vector3.zero;
|
| | | behaviour.transform.localScale = Vector3.one;
|
| | | m_ClonePropertys.Add(behaviour);
|
| | | var behaviour = GameObject.Instantiate(m_Propertys[0]);
|
| | | if (behaviour != null)
|
| | | {
|
| | | behaviour.transform.SetParent(m_Content);
|
| | | behaviour.transform.localPosition = Vector3.zero;
|
| | | behaviour.transform.localEulerAngles = Vector3.zero;
|
| | | behaviour.transform.localScale = Vector3.one;
|
| | | m_ClonePropertys.Add(behaviour);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | var rhsConfig = Config.Instance.Get<GatherSoulPropertyConfig>(rhs);
|
| | | if (lhsConfig.sort != rhsConfig.sort)
|
| | | {
|
| | | return -lhsConfig.sort.CompareTo(rhsConfig.sort);
|
| | | return lhsConfig.sort.CompareTo(rhsConfig.sort);
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
| | | [SerializeField] Button m_Resolve;
|
| | | [SerializeField] Button m_ViewProperty;
|
| | | [SerializeField] Image m_DustIcon;
|
| | | [SerializeField] Transform m_DustRaycast;
|
| | | [SerializeField] Image m_SplintersIcon;
|
| | | [SerializeField] Transform m_SplintersRaycast;
|
| | | [SerializeField] Image m_CoreIcon;
|
| | | [SerializeField] Transform m_CoreRaycast;
|
| | |
|
| | |
|
| | | VirtualPackModel virtualPack
|
| | |
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); }
|
| | | }
|
| | |
|
| | | public static float sync_topsoul_normalized = 0f;
|
| | | static float topsoul_duration = 1.067f;
|
| | | static float sync_timer = 0f;
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | |
| | | m_GotoCompose.onClick.AddListener(GotoCompose);
|
| | | m_Resolve.onClick.AddListener(Resolve);
|
| | | m_ViewProperty.onClick.AddListener(ViewProperty);
|
| | | UIEventTrigger.Get(m_DustIcon.gameObject).OnDown = (GameObject go) =>
|
| | | UIEventTrigger.Get(m_DustRaycast.gameObject).OnDown = (GameObject go) =>
|
| | | {
|
| | | ViewMoneyType(GatheringSoulModel.SOULDUST_MONEYTYPE, m_DustIcon.transform as RectTransform);
|
| | | };
|
| | | UIEventTrigger.Get(m_SplintersIcon.gameObject).OnDown = (GameObject go) =>
|
| | | UIEventTrigger.Get(m_SplintersRaycast.gameObject).OnDown = (GameObject go) =>
|
| | | {
|
| | | ViewMoneyType(GatheringSoulModel.SOULSPLINTERS_MONEYTYPE, m_SplintersIcon.transform as RectTransform);
|
| | | };
|
| | | UIEventTrigger.Get(m_CoreIcon.gameObject).OnDown = (GameObject go) =>
|
| | | UIEventTrigger.Get(m_CoreRaycast.gameObject).OnDown = (GameObject go) =>
|
| | | {
|
| | | ViewMoneyType(GatheringSoulModel.SOULCORE_MONEYTYPE, m_CoreIcon.transform as RectTransform);
|
| | | };
|
| | |
| | | Display();
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent;
|
| | | model.gatherSoulPackRefresh += GatherSoulPackRefresh;
|
| | | GatherSoulItemBehaviour.alreadyResolveEvent += AlreadyResolveEvent;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | | }
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= PlayerDataRefreshInfoEvent;
|
| | | model.gatherSoulPackRefresh -= GatherSoulPackRefresh;
|
| | | GatherSoulItemBehaviour.alreadyResolveEvent -= AlreadyResolveEvent;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void LateUpdate()
|
| | | {
|
| | | sync_topsoul_normalized = Mathf.Clamp01(sync_timer / topsoul_duration);
|
| | | if (sync_timer >= topsoul_duration)
|
| | | {
|
| | | sync_timer = 0f;
|
| | | }
|
| | | else
|
| | | {
|
| | | sync_timer += Time.deltaTime;
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | |
| | | m_ScrollerControl.m_Scorller.RefreshActiveCellViews();
|
| | | }
|
| | |
|
| | | private void AlreadyResolveEvent(Transform resolveTransform)
|
| | | {
|
| | | if (resolveTransform != null)
|
| | | {
|
| | | var effect = EffectMgr.Instance.PlayUIEffect(3076, 2200, transform, true);
|
| | | if (effect != null)
|
| | | {
|
| | | var bezierMove = effect.AddMissingComponent<BezierMove>();
|
| | | bezierMove.duration = 1.5f;
|
| | | var startPoint = resolveTransform.position;
|
| | | var endPoint = m_DustIcon.transform.position;
|
| | |
|
| | | var nl = Vector3.Normalize(endPoint - startPoint);
|
| | | var normal = new Vector3(-nl.y, nl.x, 0);
|
| | | var distance = Vector3.Distance(startPoint, endPoint);
|
| | | var pivot = startPoint + normal * UnityEngine.Random.Range(-distance, distance) * 0.7f + nl * distance * 0.4f;
|
| | | bezierMove.Begin(startPoint, pivot, endPoint, () =>
|
| | | {
|
| | | if (effect != null)
|
| | | {
|
| | | EffectMgr.Instance.RecyleUIEffect(3076, effect.gameObject);
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void ViewProperty()
|
| | | {
|
| | | if (WindowCenter.Instance.IsOpen<GatherSoulTotalPropertyWin>())
|
| | |
| | | public Dictionary<int, List<int>> gatherSoulPropertys { get; private set; }
|
| | |
|
| | | public List<int> packIndexs { get; private set; }
|
| | | public List<int> topBestSoulIndexs = new List<int>();
|
| | | public List<GatherSoulItem> resolveItems { get; private set; }
|
| | |
|
| | | public int holeCount
|
| | |
| | | public int coreHole { get; private set; }
|
| | |
|
| | | public int autoResolveRemainCount { get; private set; }
|
| | |
|
| | | public bool serverInited { get; private set; }
|
| | |
|
| | | public event Action<PackType, int> prepareResolveEvent;
|
| | |
|
| | |
|
| | | public event Action<int> gatherSoulHoleRefresh;
|
| | | public event Action gatherSoulHolesRefresh;
|
| | |
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | serverInited = false;
|
| | | packIndexs.Clear();
|
| | | topBestSoulIndexs.Clear();
|
| | | gatherSoulHoleDict.Clear();
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | serverInited = true;
|
| | | CheckAutoResolve();
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
| | | public void RefreshGatherSoulPack()
|
| | | {
|
| | | packIndexs.Clear();
|
| | | topBestSoulIndexs.Clear();
|
| | | List<int> emptyHoles;
|
| | | if (ExistEmptyHole(out emptyHoles))
|
| | | {
|
| | | emptyHoles = emptyHoles.Distinct(holeItemTypeDistinct).ToList();
|
| | | SelectBestEquipSoul(emptyHoles);
|
| | | }
|
| | | else
|
| | | if (packIndexs.Count == 0)
|
| | | {
|
| | | SelectBestReplaceSoul();
|
| | | }
|
| | |
| | | {
|
| | | packIndexs.RemoveAt(removeList[i]);
|
| | | }
|
| | | topBestSoulIndexs.AddRange(packIndexs);
|
| | | }
|
| | |
|
| | | public bool ExistEmptyHole(out List<int> list)
|
| | |
| | | {
|
| | | continue;
|
| | | }
|
| | | if (compare.itemType == GATHERSOUL_ESSENCE_TYPE)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | if (item.ExistSameProperty(compare.id)
|
| | | && item.itemColor < compare.itemColor)
|
| | | {
|
| | |
| | | };
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.GatherSoul271);
|
| | | break;
|
| | | case ItemWinBtnType.split:
|
| | | case ItemWinBtnType.dismantle:
|
| | | case ItemWinBtnType.Resolve:
|
| | | if (type == ItemWinBtnType.Resolve
|
| | | && IsBestSoul(item, item.placeType, item.index))
|
| | |
| | | if (composeModel.TryGetCompose(item.id, out compose))
|
| | | {
|
| | | var config = Config.Instance.Get<ItemConfig>(item.id);
|
| | | var baseName = config.ItemName;
|
| | | var baseName = UIHelper.AppendStringColor(config.ItemColor, config.ItemName, true);
|
| | | var sb = new StringBuilder();
|
| | | for (int i = 0; i < compose.requireItems.Count; i++)
|
| | | {
|
| | | var itemId = compose.requireItems[i];
|
| | | config = Config.Instance.Get<ItemConfig>(itemId);
|
| | | sb.Append(config.ItemName);
|
| | | sb.Append(UIHelper.AppendStringColor(config.ItemColor, config.ItemName, true));
|
| | | if (i < compose.requireItems.Count - 2)
|
| | | {
|
| | | sb.Append("、");
|
| | |
| | | if (!CheckExist(item))
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (prepareResolveEvent != null)
|
| | | {
|
| | | prepareResolveEvent(item.placeType == 0 ? PackType.rptGatherSoul : PackType.rptInterimPack,
|
| | | item.index);
|
| | | }
|
| | | SendResolvePack(new ushort[1] { (ushort)item.index }, false);
|
| | | }
|
| | |
| | | if (gatherSoulPropertys[item.id].Count > gatherSoulPropertys[holeItem.id].Count)
|
| | | {
|
| | | sameHole = IsSamePropertyCompareHoles(tryEquipHole, item);
|
| | | }
|
| | | if (sameHole != -1)
|
| | | {
|
| | | SendEquipPack((int)PackType.rptInterimPack, sameHole, (int)PackType.rptGatherSoul, 0);
|
| | | }
|
| | | SendEquipPack((int)PackType.rptGatherSoul, item.index, (int)PackType.rptInterimPack, tryEquipHole);
|
| | | }
|
| | | }
|
| | | else if (item.itemType == GATHERSOUL_CORE_TYPE)
|
| | | {
|
| | | GatherSoulItem holeItem;
|
| | | if (TryGetItem(coreHole, out holeItem))
|
| | | {
|
| | | var sameHole = -1;
|
| | | if (gatherSoulPropertys[item.id].Count > gatherSoulPropertys[holeItem.id].Count)
|
| | | {
|
| | | sameHole = IsSamePropertyCompareHoles(coreHole, item);
|
| | | }
|
| | | if (sameHole != -1)
|
| | | {
|
| | |
| | | result = (formulaResult * qualityModulus + baseValue) * soulStageModulus;
|
| | | }
|
| | | }
|
| | | return Mathf.RoundToInt(result);
|
| | | return Mathf.FloorToInt(result);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | result = formulaResult * qualityModulus * soulStageModulus;
|
| | | }
|
| | | return Mathf.RoundToInt(result);
|
| | | return Mathf.FloorToInt(result);
|
| | | }
|
| | |
|
| | | public int GetLevelByCost(int id, ulong cost)
|
| | |
| | |
|
| | | public bool ExistSameProperty(int compareId)
|
| | | {
|
| | | if (!model.gatherSoulPropertys.ContainsKey(compareId)
|
| | | || !model.gatherSoulPropertys.ContainsKey(id))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | var list = model.gatherSoulPropertys[id];
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | |
| | |
|
| | | string stepDescription = string.Empty;
|
| | |
|
| | | float refProgress = 0f;
|
| | | float behaviourProgress = 0f;
|
| | | float trueProgress = 0f;
|
| | |
|
| | | float timer = 0.1f;
|
| | | float interval = 0.1f;
|
| | |
| | | {
|
| | | backGroundTimer = 0f;
|
| | | backGroundIndex = 0;
|
| | | refProgress = 0f;
|
| | | behaviourProgress = 0f;
|
| | | trueProgress = 0f;
|
| | | m_ProgressSlider.ResetValue(0f);
|
| | | m_AlphaTween.SetStartState();
|
| | |
|
| | |
| | |
|
| | | void UpdateLoadingProgress(Launch.LaunchStage _stage, float _progress)
|
| | | {
|
| | | trueProgress = Mathf.Max(_progress, behaviourProgress);
|
| | | behaviourProgress = _progress;
|
| | | switch (_stage)
|
| | | {
|
| | | case Launch.LaunchStage.AssetCopy:
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | if (trueProgress > 0.9599f)
|
| | | {
|
| | | behaviourProgress = Mathf.Clamp01(behaviourProgress + Time.deltaTime * 0.2f);
|
| | | }
|
| | | else
|
| | | {
|
| | | behaviourProgress = Mathf.SmoothDamp(behaviourProgress, trueProgress, ref refProgress, 0.2f);
|
| | | }
|
| | |
|
| | | m_ProgressSlider.value = behaviourProgress;
|
| | | m_Progress.text = VersionUtility.Instance.IsShangGu() ? stepDescription :
|
| | | StringUtility.Contact(stepDescription, Mathf.RoundToInt(behaviourProgress * 100), "%");
|
| | |
| | | { |
| | | public class CrossServerLogin : Singleton<CrossServerLogin> |
| | | { |
| | | bool m_ReconnecBackGround = false; |
| | | public bool reconnectBackGround { |
| | | get { return m_ReconnecBackGround; } |
| | | set { m_ReconnecBackGround = value; } |
| | | } |
| | | |
| | | bool m_Busy = false; |
| | | public bool busy { |
| | | get { return m_Busy; } |
| | | set { m_Busy = value; } |
| | | } |
| | | |
| | | int reLoginTime = 0; |
| | | Clock loginOverTimeClock; |
| | | |
| | | public CrossServerOneVsOne oneVsOnePlayerData { get; private set; } |
| | | |
| | |
| | | } |
| | | |
| | | busy = true; |
| | | reLoginTime = 0; |
| | | |
| | | try |
| | | { |
| | | reconnectBackGround = false; |
| | | accountBuf = account; |
| | | ipBuf = ip; |
| | | gamePortBuf = gamePort; |
| | | |
| | | if (loginOverTimeClock != null) |
| | | { |
| | | loginOverTimeClock.Stop(); |
| | | } |
| | | loginOverTimeClock = Clock.Create(DateTime.Now + new TimeSpan(15 * TimeSpan.TicksPerSecond), ProcessLoginFailure); |
| | | GameNetSystem.Instance.BeginConnectCrossServer(ipBuf, gamePortBuf, OnGameServerConnected); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | |
| | | busy = true; |
| | | reconnectBackGround = true; |
| | | |
| | | try |
| | | { |
| | | if (loginOverTimeClock != null) |
| | | { |
| | | loginOverTimeClock.Stop(); |
| | | } |
| | | |
| | | loginOverTimeClock = Clock.Create(DateTime.Now + new TimeSpan(15 * TimeSpan.TicksPerSecond), ProcessLoginFailure); |
| | | GameNetSystem.Instance.BeginConnectCrossServer(ipBuf, gamePortBuf, OnGameServerConnected); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | |
| | | public void AccessLogin(H0101_tagServerPrepared _serverInfo) |
| | | { |
| | | var send = new C0101_tagCPlayerLogin(); |
| | | switch (VersionConfig.Get().versionAuthority) |
| | | { |
| | | case VersionAuthority.InterTest: |
| | | send.IDType = 1; |
| | | send.AccID = accountBuf; |
| | | send.Password = "64e228993a2e7820004fec23251da204"; |
| | | send.MAC = DeviceUtility.GetMac(); |
| | | send.Version = _serverInfo.Version; |
| | | send.LineNO = 255; |
| | | send.AppID = VersionConfig.Get().appId; |
| | | send.AccountID = 1000;// 内部登陆的时候的id |
| | | send.TokenExpire = "1519750743000";// 内部登陆的时长,无所谓的 |
| | | send.Phone = 0; |
| | | send.ServerID = (uint)ServerListCenter.Instance.currentServer.region_flag; |
| | | send.Adult = 1; |
| | | send.ExtraLen = 0; |
| | | send.Extra = ""; |
| | | break; |
| | | case VersionAuthority.Release: |
| | | send.Extra = VersionConfig.Get().SpID; |
| | | send.ExtraLen = (byte)send.Extra.Length; |
| | | if (SDKUtility.Instance.ChannelPlatform == SDKUtility.E_ChannelPlatform.Free) |
| | | { |
| | | send.IDType = 1; |
| | | } |
| | | else if (SDKUtility.Instance.ChannelPlatform == SDKUtility.E_ChannelPlatform.Mr) |
| | | { |
| | | send.IDType = 2; |
| | | } |
| | | else if (SDKUtility.Instance.ChannelPlatform == SDKUtility.E_ChannelPlatform.Sp) |
| | | { |
| | | send.IDType = 3; |
| | | send.Extra += ("|" + SDKUtility.Instance.FreePlatformInfo.sessionID); |
| | | send.ExtraLen = (byte)send.Extra.Length; |
| | | } |
| | | else if (SDKUtility.Instance.ChannelPlatform == SDKUtility.E_ChannelPlatform.Js) |
| | | { |
| | | send.IDType = 4; |
| | | send.Extra += ("|" + loginModel.sdkLoginResult.token); |
| | | send.ExtraLen = (byte)send.Extra.Length; |
| | | } |
| | | else if (SDKUtility.Instance.ChannelPlatform == SDKUtility.E_ChannelPlatform.Yj) |
| | | { |
| | | send.IDType = 5; |
| | | send.Extra += ("|" + SDKUtility.Yj_SpID + "|" + |
| | | SDKUtility.Yj_AppID + "|" + |
| | | SDKUtility.Instance.FreePlatformInfo.accountID); |
| | | send.ExtraLen = (byte)send.Extra.Length; |
| | | } |
| | | send.AccID = loginModel.sdkLoginResult.account; |
| | | send.Password = loginModel.sdkLoginResult.token; |
| | | send.MAC = DeviceUtility.GetMac(); |
| | | send.Version = _serverInfo.Version; |
| | | send.LineNO = 255; |
| | | send.AppID = VersionConfig.Get().appId; |
| | | send.AccountID = (uint)loginModel.sdkLoginResult.accountID;// 内部登陆的时候的id |
| | | send.TokenExpire = loginModel.sdkLoginResult.tokenExpire; |
| | | if (SDKUtility.Instance.ChannelPlatform == SDKUtility.E_ChannelPlatform.Sp) |
| | | { |
| | | send.TokenExpire = SDKUtility.Instance.FreePlatformInfo.timeStamp; |
| | | } |
| | | send.Phone = (byte)loginModel.sdkLoginResult.phone; |
| | | send.ServerID = (uint)ServerListCenter.Instance.currentServer.region_flag; |
| | | if (loginModel.sdkIDCheckIDAuthentication.type == "1") |
| | | { |
| | | send.Adult = 1; |
| | | } |
| | | else if (loginModel.sdkIDCheckIDAuthentication.type == "2") |
| | | { |
| | | send.Adult = MathUtility.CheckAdult(loginModel.sdkIDCheckIDAuthentication.card_id) ? (byte)1 : (byte)0; |
| | | } |
| | | else |
| | | { |
| | | send.Adult = 0; |
| | | } |
| | | break; |
| | | } |
| | | |
| | | GameNetSystem.Instance.SendToCrossServer(send); // 登录 |
| | | GameNetSystem.Instance.SendToCrossServer(loginModel.Get0101SendPackage(_serverInfo)); // 登录 |
| | | } |
| | | |
| | | public void CheckClientVersion() |
| | |
| | | tagCRoleLoginAsk.Type = (byte)_type;//进入游戏 |
| | | tagCRoleLoginAsk.ClientID = SDKUtility.Instance.RegistrationID; |
| | | GameNetSystem.Instance.SendToCrossServer(tagCRoleLoginAsk); |
| | | |
| | | if (loginOverTimeClock != null) |
| | | { |
| | | loginOverTimeClock.Stop(); |
| | | } |
| | | } |
| | | |
| | | private void ProcessLoginFailure() |
| | | { |
| | | if (reLoginTime < 1) |
| | | { |
| | | busy = false; |
| | | reLoginTime++; |
| | | ReAccountLogin(); |
| | | } |
| | | else |
| | | { |
| | | //需要服务端再给一个封包来处理登录跨服失败的情况 |
| | | loginModel.ReAccountLogin(); |
| | | } |
| | | } |
| | | |
| | | private void OnApplicationOut() |
| | |
| | | GameNetSystem.Instance.SendToCrossServer(sendInfo); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | public struct CrossServerOneVsOne |
| | | { |
| | |
| | |
|
| | | public void AccessLogin(H0101_tagServerPrepared _serverInfo)
|
| | | {
|
| | | GameNetSystem.Instance.SendInfo(Get0101SendPackage(_serverInfo)); // 登录
|
| | | }
|
| | |
|
| | | public C0101_tagCPlayerLogin Get0101SendPackage(H0101_tagServerPrepared _serverInfo)
|
| | | {
|
| | | var send = new C0101_tagCPlayerLogin();
|
| | |
|
| | | switch (VersionConfig.Get().versionAuthority)
|
| | |
| | | break;
|
| | | }
|
| | |
|
| | | GameNetSystem.Instance.SendInfo(send); // 登录
|
| | | return send;
|
| | | }
|
| | |
|
| | | public void CheckClientVersion()
|
| | |
| | |
|
| | | private void IsCrossServerOneVsOne()
|
| | | {
|
| | | if (CrossServerRewardModel.IsCrossServer())//是否再跨服副本中
|
| | | if (CrossServerRewardModel.IsCrossServerOneVsOne())//是否再跨服副本中
|
| | | {
|
| | | if (!WindowCenter.Instance.IsOpen("FightingPKWin"))
|
| | | {
|
| | |
| | | var functionOrder = 0;
|
| | | var godWeaponModel = ModelCenter.Instance.GetModel<MagicianModel>();
|
| | | var gatherSoulModel = ModelCenter.Instance.GetModel<GatheringSoulModel>();
|
| | | if (MainRedDot.Instance.roleRedpoint.state != RedPointState.None)
|
| | | if (MainRedDot.Instance.roleTagRedpoint.state != RedPointState.None)
|
| | | {
|
| | | functionOrder = 0;
|
| | | }
|
| | |
| | | runeValue = params1 * params2 + baseValue;
|
| | | }
|
| | | }
|
| | | return Mathf.RoundToInt(runeValue);
|
| | | return Mathf.FloorToInt(runeValue);
|
| | | }
|
| | | private Dictionary<int, float> runeExpResultDict = new Dictionary<int, float>();
|
| | | public int GetRuneNeedExp(int id, int level)
|
| | |
| | | _levelUpExp = _result * runeExpDic[_tagChinModel.ItemColor];
|
| | | }
|
| | | }
|
| | | return Mathf.RoundToInt(_levelUpExp);
|
| | | return Mathf.FloorToInt(_levelUpExp);
|
| | | }
|
| | |
|
| | | public float GetRuneSoulBreakExp(RuneData _rune)
|
| | |
| | |
|
| | | [XLua.LuaCallCSharp]
|
| | | public class SettingEffectMgr : SingletonMonobehaviour<SettingEffectMgr>
|
| | | |
| | |
|
| | | {
|
| | | private bool _isAutoHangUp = false;
|
| | | private ItemConfig _tagItemModel;
|
| | |
| | | {
|
| | | get { return _storeModel ?? (_storeModel = ModelCenter.Instance.GetModel<StoreModel>()); }
|
| | | }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | |
|
| | | public bool isPlayerDie { get; private set; }
|
| | |
|
| | |
| | | /// </summary>
|
| | | private void AutoDrugSetting()
|
| | | {
|
| | | int dataMapId = dungeonModel.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID);
|
| | | if (dataMapId == CrossServerOneVsOneModel.CrossServerDataMapId) return;
|
| | |
|
| | | float hpPercent = Mathf.RoundToInt((float)PlayerDatas.Instance.baseData.HP / PlayerDatas.Instance.extersion.MaxHP * 100);
|
| | | if (hpPercent <= HangUpSetModel.Instance.GetHpSet())
|
| | |
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | | using LitJson;
|
| | | using TableConfig;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
| | | m_AntiAddition.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | var switchAccountJson = JsonMapper.ToObject(Config.Instance.Get<FuncSwitchConfig>(2).AppIdSwitch);
|
| | | if (switchAccountJson.Keys.Contains(VersionConfig.Get().appId) && switchAccountJson[VersionConfig.Get().appId].ToString() == "0")
|
| | | {
|
| | | m_SwitchAccountBtn.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_SwitchAccountBtn.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | loginModel.accountBindOkEvent += UpdateAccountBindTitle;
|
| | | SDKUtility.Instance.onFreePlatfromDoIDAuthenticationOk += OnAuthenticationOk;
|
| | | SystemSetting.Instance.gameFrameChangeEvent += OnSwitchGameFrame;
|
| | |
| | | case JumpUIType.RoleFunc2:
|
| | | case JumpUIType.RoleFunc3:
|
| | | case JumpUIType.RoleFunc4:
|
| | | case JumpUIType.GatherSoul272:
|
| | | case JumpUIType.GatherSoul273:
|
| | | SetJumpLogic<RolePanel>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.KnapSackFunc1:
|
| | |
| | | EquipCompose269 = 269, //装备合成-9阶红色2星玉佩
|
| | | EquipCompose270 = 270, //装备合成-10阶红色3星玉佩
|
| | | GatherSoul271 = 271, //聚魂合成
|
| | | GatherSoul272 = 272, //聚魂镶嵌界面
|
| | | GatherSoul273 = 273, //聚魂镶嵌界面
|
| | | DhszTs = 1001,//定海神针功法提升界面
|
| | | HyqTs = 1002,//皓月枪功法提升界面
|
| | | GyzTs = 1003,//鬼牙刃功法提升界面
|
| | |
| | | Def_mitDogzEquipPlus = 21,// 神兽装备强化
|
| | | Def_mitRuneCompound = 22,//符印合成
|
| | | Def_mitGatherSoulCompound = 23,//聚魂合成
|
| | | Def_mitGatherSoulDecompose = 24,//聚魂分解
|
| | | }
|
| | | /// <summary>
|
| | | /// 金钱类型(虚拟物品)
|