Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A9 04 查询boss信息 #tagCGQueryBossInfo |
| | | |
| | | public class CA904_tagCGQueryBossInfo : GameNetPackBasic |
| | | { |
| | | public byte Count; //数量 |
| | | public uint[] BossIDList; //boosid |
| | | |
| | | public CA904_tagCGQueryBossInfo() |
| | | { |
| | | combineCmd = (ushort)0x1801; |
| | | _cmd = (ushort)0xA904; |
| | | } |
| | | |
| | | public override void WriteToBytes() |
| | | { |
| | | WriteBytes(Count, NetDataType.BYTE); |
| | | WriteBytes(BossIDList, NetDataType.DWORD, Count); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e8252f9152b018e4596b3d11fc2e9e12 |
| | | timeCreated: 1544085662 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 722e5e3d30096674e811f5bd191246a0 |
| | | folderAsset: yes |
| | | timeCreated: 1539228128 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | |
|
| | | Vector3 _destPosition = new Vector3((vNetData.DestPosX - GA_Hero.MapOffset.x) * .5f, _actor.Pos.y, (vNetData.DestPosY - GA_Hero.MapOffset.z) * .5f);
|
| | |
|
| | |
|
| | | if (_actor is GA_Pet)
|
| | | {
|
| | | if (MathUtility.DistanceSqrtXZ(_destPosition, _actor.Pos) < 2f)
|
| | | //float _distance = MathUtility.DistanceSqrtXZ(_destPosition, _actor.Pos);
|
| | | //Debug.LogFormat("收到宠物移动包: {0} 当前坐标: {1}, 将要移动到: {2}, 当前距离: {3}", vNetData.ObjID, new Vector2((int)(_actor.Pos.x * 2), (int)(_actor.Pos.z * 2)),
|
| | | // new Vector2(vNetData.DestPosX, vNetData.DestPosY), _distance);
|
| | | if (MathUtility.DistanceSqrtXZ(_destPosition, _actor.Pos) < 0.2f)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | { |
| | | base.OnUpdate(owner, animator, stateInfo, layerIndex); |
| | | |
| | | if (owner is GA_Pet) |
| | | { |
| | | if (animator.IsInTransition(0) |
| | | && (animator.GetNextAnimatorStateInfo(0).shortNameHash == GAStaticDefine.State_IdleHash |
| | | || animator.GetNextAnimatorStateInfo(0).shortNameHash == GAStaticDefine.State_RunHash)) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | |
| | | if (owner.State != E_ActorState.AutoRun) |
| | | { |
| | | if (owner.destForward != Vector3.zero) |
| | |
| | | public Dictionary<int, string> s_NpcID2BundleName = new Dictionary<int, string>();
|
| | | public Dictionary<int, string> s_NpcID2Assetname = new Dictionary<int, string>();
|
| | |
|
| | |
|
| | |
|
| | | public event UnityAction<uint> OnGActorRequest;
|
| | | public event UnityAction<uint> OnGActorServerDie;
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a545fb3dcf719304fa74180c10219375 |
| | | folderAsset: yes |
| | | timeCreated: 1542357825 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | private void SetMidUI()
|
| | | {
|
| | | _describeText.alignment = TextAnchor.UpperLeft;
|
| | | if (itemPathModel.chinItemModel.Effect1 != 215)
|
| | | {
|
| | | _describeText.text = itemPathModel.GetAllInfoDes();
|
| | | }
|
| | | else
|
| | | string infoDes = itemPathModel.GetAllInfoDes();
|
| | | if (infoDes.Contains("{Exp}"))
|
| | | {
|
| | | ulong expValue = itemTipsModel.GetAddExpValue(itemPathModel.chinItemModel.EffectValueA1, itemPathModel.chinItemModel.EffectValueB1);
|
| | | _describeText.text = itemPathModel.GetAllInfoDes().Replace("{0}", UIHelper.ReplaceLargeNum(expValue));
|
| | | infoDes = infoDes.Replace("{Exp}", UIHelper.ReplaceLargeNum(expValue));
|
| | | }
|
| | | |
| | | if (infoDes.Contains("{FightPower}"))
|
| | | {
|
| | | int fightPower = 0;
|
| | | itemTipsModel.TryGetFightPowerByItemId(itemPathModel.chinItemModel.ID, out fightPower);
|
| | | infoDes = infoDes.Replace("{FightPower}", fightPower.ToString());
|
| | | }
|
| | |
|
| | | _describeText.text = infoDes;
|
| | | }
|
| | |
|
| | | #region 点击事件
|
| | |
| | | [SerializeField] TimerBehaviour m_RebornTime;
|
| | | [SerializeField] Text m_Alive;
|
| | | [SerializeField] Text m_RebornAtOnce;
|
| | | [SerializeField] RebornRightNowBossInfoQuery m_BossInfoQuery;
|
| | |
|
| | | int bossId = 0;
|
| | | FindPreciousModel model { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } }
|
| | |
| | | var config = Config.Instance.Get<NPCConfig>(bossId);
|
| | | m_Level.text = Language.Get("Z1024", config.NPCLV);
|
| | |
|
| | | m_BossInfoQuery.bossId = bossId;
|
| | | OnBossInfoUpdate(bossId);
|
| | | model.bossInfoUpdateEvent -= OnBossInfoUpdate;
|
| | | model.bossInfoUpdateEvent += OnBossInfoUpdate;
|
| | |
|
| | | m_MoveTo.RemoveAllListeners();
|
| | |
| | | var behaviour = behaviours[i];
|
| | | if (i < bosses.Count)
|
| | | {
|
| | | behaviour.Dispose();
|
| | | behaviour.Display(bosses[i], OnMoveToBoss);
|
| | | behaviour.gameObject.SetActive(true);
|
| | | }
|
| | |
| | | base.Display(_data);
|
| | | bossId = (int)_data;
|
| | |
|
| | | var bossInfoQuery = this.AddMissingComponent<RebornRightNowBossInfoQuery>();
|
| | | bossInfoQuery.bossId = bossId;
|
| | | findPreciousModel.bossSubscribeChangeEvent -= OnSubscribe;
|
| | | findPreciousModel.bossSubscribeChangeEvent += OnSubscribe;
|
| | | findPreciousModel.bossInfoUpdateEvent -= OnBossInfoUpdate;
|
| | |
| | | GameNetSystem.Instance.SendInfo(sendInfo);
|
| | | }
|
| | |
|
| | | public void RequestQueryBossInfo(int bossId)
|
| | | {
|
| | | var sendInfo = new CA904_tagCGQueryBossInfo();
|
| | | sendInfo.Count = 1;
|
| | | sendInfo.BossIDList = new uint[] { (uint)bossId };
|
| | | GameNetSystem.Instance.SendInfo(sendInfo);
|
| | | }
|
| | |
|
| | | public void OnPreciousDropRecordUpdate(HA003_tagUniversalGameRecInfo _serverInfo)
|
| | | {
|
| | | if (_serverInfo.Type != 25)
|
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Thursday, December 06, 2018 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class RebornRightNowBossInfoQuery : MonoBehaviour |
| | | { |
| | | public int bossId { get; set; } |
| | | |
| | | FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } } |
| | | bool isRebornRightNow { |
| | | get { |
| | | FindPreciousModel.BossInfo bossInfo = null; |
| | | if (findPreciousModel.TryGetBossInfo(bossId, out bossInfo)) |
| | | { |
| | | return !findPreciousModel.IsBossAlive(bossId) && TimeUtility.ServerNow > bossInfo.refreshTime; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | |
| | | float rebornRightNowBossQueryTime = 0f; |
| | | private void OnEnable() |
| | | { |
| | | rebornRightNowBossQueryTime = 0f; |
| | | } |
| | | |
| | | private void LateUpdate() |
| | | { |
| | | if (Time.realtimeSinceStartup > rebornRightNowBossQueryTime) |
| | | { |
| | | if (isRebornRightNow) |
| | | { |
| | | rebornRightNowBossQueryTime = Time.realtimeSinceStartup + 5f; |
| | | findPreciousModel.RequestQueryBossInfo(bossId); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f4bfabd35e5383641b417cc69d91d52f |
| | | timeCreated: 1544086386 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | CheckUselimit();
|
| | | }
|
| | |
|
| | | itemDesText.text = itemTipsModel.curAttrData.GetAllInfoDes();
|
| | | string infoDes = itemTipsModel.curAttrData.GetAllInfoDes();
|
| | | if (infoDes.Contains("{Exp}"))
|
| | | {
|
| | | ulong expValue = itemTipsModel.GetAddExpValue(itemTipsModel.curAttrData.itemConfig.EffectValueA1, itemTipsModel.curAttrData.itemConfig.EffectValueB1);
|
| | | infoDes = infoDes.Replace("{Exp}", UIHelper.ReplaceLargeNum(expValue));
|
| | | }
|
| | | if (infoDes.Contains("{FightPower}"))
|
| | | {
|
| | | int fightPower = 0;
|
| | | itemTipsModel.TryGetFightPowerByItemId(itemTipsModel.curAttrData.itemId, out fightPower);
|
| | | infoDes = infoDes.Replace("{FightPower}", fightPower.ToString());
|
| | | }
|
| | |
|
| | | itemDesText.text = infoDes;
|
| | | operateBtn.SetActive(false);
|
| | |
|
| | | CreateFuncBtn();
|
| | |
| | | itemCell.Init(cellModel);
|
| | |
|
| | | CheckUselimit();
|
| | | if(itemTipsModel.curAttrData.itemConfig.Effect1 != 215)
|
| | | {
|
| | | int type = 0;
|
| | | bool isContain = itemTipsModel.TryGetContainsParamsType(itemTipsModel.curAttrData.itemId,out type);
|
| | | if(isContain)
|
| | | {
|
| | | switch(type)
|
| | | {
|
| | | case 1:
|
| | | int fightPower = 0;
|
| | | itemTipsModel.TryGetFightPowerByItemId(itemTipsModel.curAttrData.itemId, out fightPower);
|
| | | itemDesText.text = itemTipsModel.curAttrData.GetAllInfoDes().Replace("{0}",fightPower.ToString());
|
| | | break;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | itemDesText.text = itemTipsModel.curAttrData.GetAllInfoDes();
|
| | | }
|
| | | }
|
| | | else
|
| | |
|
| | | string infoDes = itemTipsModel.curAttrData.GetAllInfoDes();
|
| | | if(infoDes.Contains("{Exp}"))
|
| | | {
|
| | | ulong expValue = itemTipsModel.GetAddExpValue(itemTipsModel.curAttrData.itemConfig.EffectValueA1, itemTipsModel.curAttrData.itemConfig.EffectValueB1);
|
| | | itemDesText.text = itemTipsModel.curAttrData.GetAllInfoDes().Replace("{0}", UIHelper.ReplaceLargeNum(expValue));
|
| | | infoDes = infoDes.Replace("{Exp}", UIHelper.ReplaceLargeNum(expValue));
|
| | | }
|
| | | if(infoDes.Contains("{FightPower}"))
|
| | | {
|
| | | int fightPower = 0;
|
| | | itemTipsModel.TryGetFightPowerByItemId(itemTipsModel.curAttrData.itemId, out fightPower);
|
| | | infoDes = infoDes.Replace("{FightPower}", fightPower.ToString());
|
| | | }
|
| | |
|
| | | itemDesText.text = infoDes;
|
| | | operateBtn.SetActive(false);
|
| | |
|
| | | CreateFuncBtn();
|
| | |
| | | FuncConfigConfig EquipOutWordID = Config.Instance.Get<FuncConfigConfig>("EquipOutWordID");
|
| | | PeerlessEquipIds = ConfigParse.GetMultipleStr<int>(EquipOutWordID.Numerical1);
|
| | |
|
| | | FuncConfigConfig ItemTipsNum = Config.Instance.Get<FuncConfigConfig>("ItemTipsNum");
|
| | | JsonData itemParamsData = JsonMapper.ToObject(ItemTipsNum.Numerical1);
|
| | | itemParamsDict = new Dictionary<int, List<int>>();
|
| | | foreach (var type in itemParamsData.Keys)
|
| | | {
|
| | | List<int> list = new List<int>();
|
| | | itemParamsDict.Add(int.Parse(type),list);
|
| | | if(itemParamsData[type].IsArray)
|
| | | {
|
| | | for (int i = 0; i < itemParamsData[type].Count; i++)
|
| | | {
|
| | | int num = 0;
|
| | | int.TryParse(itemParamsData[type][i].ToString(),out num);
|
| | | list.Add(num);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | FuncConfigConfig legendAttrColor = Config.Instance.Get<FuncConfigConfig>("LegendAttrColor");
|
| | | equipLegendAttrTypeDict = new Dictionary<int, List<int>>();
|
| | | wingsLegendAttrColorDict = new Dictionary<int, Dictionary<int, string>>();
|
| | |
| | |
|
| | | private StringBuilder attrSB = new StringBuilder();
|
| | | private PlayerPropertyConfig playerProModel;
|
| | |
|
| | | public bool TryGetContainsParamsType(int param,out int _type)
|
| | | {
|
| | | _type = 0;
|
| | | foreach(var type in itemParamsDict.Keys)
|
| | | {
|
| | | var list = itemParamsDict[type];
|
| | | if(list.Contains(param))
|
| | | {
|
| | | _type = type;
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | #region 设置装备基础信息
|
| | | /// <summary>
|
| | |
| | |
|
| | | if (itemTipsModel.randomRuneIds.Contains(itemConfig.ID))
|
| | | {
|
| | | return string.Format(itemConfig.Description, GetExtraInfos());
|
| | | return itemConfig.Description.Replace("{Rune}", GetExtraInfos());
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | |
|
| | | IEnumerator WaitAddTask(int MissionID, int MissionState)
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS800;//缓冲一秒再进行
|
| | | yield return WaitingForSecondConst.WaitMS300;//缓冲0.3秒再进行
|
| | | var inDungeon = IsDungeon();
|
| | | TaskScheduling();
|
| | | if (WindowCenter.Instance.IsOpen<MainInterfaceWin>() && !inDungeon)
|
| | |
| | |
|
| | | CheckUselimit();
|
| | |
|
| | | if (itemTipsModel.curAttrData.itemConfig.Effect1 != 215)
|
| | | {
|
| | | int type = 0;
|
| | | bool isContain = itemTipsModel.TryGetContainsParamsType(itemTipsModel.curAttrData.itemId, out type);
|
| | | if (isContain)
|
| | | {
|
| | | switch (type)
|
| | | {
|
| | | case 1:
|
| | | int fightPower = 0;
|
| | | itemTipsModel.TryGetFightPowerByItemId(itemTipsModel.curAttrData.itemId, out fightPower);
|
| | | itemDesText.text = itemTipsModel.curAttrData.itemConfig.Description.Replace("{0}",fightPower.ToString());
|
| | | break;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | itemDesText.text = itemTipsModel.curAttrData.itemConfig.Description;
|
| | | }
|
| | | |
| | | }
|
| | | else
|
| | | string infoDes = itemTipsModel.curAttrData.GetAllInfoDes();
|
| | | if (infoDes.Contains("{Exp}"))
|
| | | {
|
| | | ulong expValue = itemTipsModel.GetAddExpValue(itemTipsModel.curAttrData.itemConfig.EffectValueA1, itemTipsModel.curAttrData.itemConfig.EffectValueB1);
|
| | | itemDesText.text = itemTipsModel.curAttrData.itemConfig.Description.Replace("{0}", UIHelper.ReplaceLargeNum(expValue));
|
| | | infoDes = infoDes.Replace("{Exp}", UIHelper.ReplaceLargeNum(expValue));
|
| | | }
|
| | | if (infoDes.Contains("{FightPower}"))
|
| | | {
|
| | | int fightPower = 0;
|
| | | itemTipsModel.TryGetFightPowerByItemId(itemTipsModel.curAttrData.itemId, out fightPower);
|
| | | infoDes = infoDes.Replace("{FightPower}", fightPower.ToString());
|
| | | }
|
| | | itemDesText.text = infoDes;
|
| | |
|
| | | if (itemTipsModel.curAttrData.itemConfig.ExpireTime > 0)
|
| | | {
|
| | |
| | | DisplayUseLimit(itemConfig);
|
| | | }
|
| | |
|
| | | m_Description.text = itemTipsModel.curAttrData.GetAllInfoDes();
|
| | | string infoDes = itemTipsModel.curAttrData.GetAllInfoDes();
|
| | | if (infoDes.Contains("{Exp}"))
|
| | | {
|
| | | ulong expValue = itemTipsModel.GetAddExpValue(itemTipsModel.curAttrData.itemConfig.EffectValueA1, itemTipsModel.curAttrData.itemConfig.EffectValueB1);
|
| | | infoDes = infoDes.Replace("{Exp}", UIHelper.ReplaceLargeNum(expValue));
|
| | | }
|
| | | if (infoDes.Contains("{FightPower}"))
|
| | | {
|
| | | int fightPower = 0;
|
| | | itemTipsModel.TryGetFightPowerByItemId(itemTipsModel.curAttrData.itemId, out fightPower);
|
| | | infoDes = infoDes.Replace("{FightPower}", fightPower.ToString());
|
| | | }
|
| | |
|
| | | m_Description.text = infoDes;
|
| | |
|
| | | int useCnt = BoxModel.GetUseCntByID(itemTipsModel.curAttrData.itemId);
|
| | | m_UseTimes.gameObject.SetActive(itemConfig.MaxSkillCnt > 0);
|
| | |
| | | [SerializeField] TimerBehaviour m_TimeBehaviour;
|
| | | [SerializeField] Text m_RebornTime;
|
| | | [SerializeField] Text m_NpcAppearTxt;
|
| | | [SerializeField] RebornRightNowBossInfoQuery m_BossInfoQuery;
|
| | | [SerializeField] Text m_FuncTxt;
|
| | |
|
| | | bool secondTextInited = false;
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | m_BossInfoQuery.bossId = npcId;
|
| | | FindPreciousModel.BossInfo _bossInfo;
|
| | | if (findPreciousModel.TryGetBossInfo(npcId, out _bossInfo))
|
| | | {
|
| | | m_RebornTime.gameObject.SetActive(true);
|
| | | (m_TimeBehaviour as TimerToChsBehaviour).addtionInfo = Language.Get("BossReborn_RefreshTime");
|
| | | m_TimeBehaviour.Begin( (int)(_bossInfo.refreshTime - TimeUtility.ServerNow).TotalSeconds, () =>
|
| | | {
|
| | | m_NpcAppearTxt.gameObject.SetActive(true);
|
| | | });
|
| | | m_TimeBehaviour.Begin((int)(_bossInfo.refreshTime - TimeUtility.ServerNow).TotalSeconds, () =>
|
| | | {
|
| | | m_NpcAppearTxt.gameObject.SetActive(true);
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | m_RebornTime.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | m_NpcAppearTxt.gameObject.SetActive(!m_RebornTime.gameObject.activeSelf);
|
| | | }
|
| | |
|