Merge branch 'master' into HazyRegion
Conflicts:
Fight/Actor/Status/StatusMgr.cs
2 文件已重命名
2个文件已添加
69个文件已修改
| | |
| | | {
|
| | | if (clock != null) |
| | | {
|
| | | clock.Stop(); |
| | | Clock.Stop(clock);
|
| | | }
|
| | | clock = null;
|
| | |
|
| | |
| | |
|
| | | if (clock != null) |
| | | {
|
| | | clock.Stop(); |
| | | Clock.Stop(clock);
|
| | | }
|
| | | clock = Clock.Create(DateTime.Now + new TimeSpan(_seconds * TimeSpan.TicksPerSecond), OnDetectEnd);
|
| | | clock = Clock.AlarmAt(DateTime.Now + new TimeSpan(_seconds * TimeSpan.TicksPerSecond), OnDetectEnd);
|
| | | } |
| | | |
| | | private void OnDetectEnd()
|
| | |
| | | {
|
| | | if (clock != null) |
| | | {
|
| | | clock.Stop(); |
| | | Clock.Stop(clock);
|
| | | }
|
| | | clock = null;
|
| | | base.OnExit();
|
| | |
| | |
|
| | | if (clock != null) |
| | | {
|
| | | clock.Stop(); |
| | | Clock.Stop(clock);
|
| | | }
|
| | | clock = Clock.Create(DateTime.Now + new TimeSpan(_seconds * TimeSpan.TicksPerSecond), OnDetectEnd);
|
| | | clock = Clock.AlarmAt(DateTime.Now + new TimeSpan(_seconds * TimeSpan.TicksPerSecond), OnDetectEnd);
|
| | | }
|
| | |
|
| | | private void OnDetectEnd()
|
| | |
| | | #endif
|
| | | #endif
|
| | |
|
| | |
|
| | | tasks.Enqueue(checkAssetValidTask);
|
| | | tasks.Enqueue(downLoadAssetTask);
|
| | | tasks.Enqueue(assetBundleInitTask);
|
| | |
| | |
|
| | | GlobalTimeEvent.Instance.Begin();
|
| | | PackageRegedit.Init();
|
| | | Clock.Init();
|
| | |
|
| | | // ## PocoManager Start
|
| | | if (VersionConfig.Get().appId.Equals("test"))
|
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: Fish
|
| | | // [ Date ]: Thursday, February 14, 2019
|
| | | // [ Date ]: Friday, April 12, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | public readonly int MapID;
|
| | | public readonly string Name;
|
| | | public readonly int LV;
|
| | | public readonly int realmLevel;
|
| | | public readonly int MapFBType;
|
| | | public readonly int LocalReborn;
|
| | | public readonly int SkillReborn;
|
| | |
| | |
|
| | | int.TryParse(tables[2],out LV);
|
| | |
|
| | | int.TryParse(tables[3],out MapFBType); |
| | | int.TryParse(tables[3],out realmLevel); |
| | |
|
| | | int.TryParse(tables[4],out LocalReborn); |
| | | int.TryParse(tables[4],out MapFBType); |
| | |
|
| | | int.TryParse(tables[5],out SkillReborn); |
| | | int.TryParse(tables[5],out LocalReborn); |
| | |
|
| | | int.TryParse(tables[6],out CanRide); |
| | | int.TryParse(tables[6],out SkillReborn); |
| | |
|
| | | int.TryParse(tables[7],out CanOutPet); |
| | | int.TryParse(tables[7],out CanRide); |
| | |
|
| | | int.TryParse(tables[8],out TeamLimit); |
| | | int.TryParse(tables[8],out CanOutPet); |
| | |
|
| | | string[] BornPointsStringArray = tables[9].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | int.TryParse(tables[9],out TeamLimit); |
| | |
|
| | | string[] BornPointsStringArray = tables[10].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | BornPoints = new Vector3[BornPointsStringArray.Length]; |
| | | for (int i=0;i<BornPointsStringArray.Length;i++) |
| | | { |
| | | BornPoints[i]=BornPointsStringArray[i].Vector3Parse(); |
| | | }
|
| | |
|
| | | int.TryParse(tables[10],out MainTaskID); |
| | | int.TryParse(tables[11],out MainTaskID); |
| | |
|
| | | MapTaskText = tables[11];
|
| | | MapTaskText = tables[12];
|
| | |
|
| | | int.TryParse(tables[12],out Camp); |
| | | int.TryParse(tables[13],out Camp); |
| | |
|
| | | int.TryParse(tables[13],out AtkType); |
| | | int.TryParse(tables[14],out AtkType); |
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | |
| | | fileFormatVersion: 2 |
| | | guid: db9da28a811a0af4db68188db3a20863 |
| | | timeCreated: 1550121374 |
| | | timeCreated: 1555048178 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: Fish |
| | | // [ Date ]: Monday, March 25, 2019 |
| | | // [ Date ]: Saturday, April 13, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | |
| | | |
| | | public readonly int id;
|
| | | public readonly Int2 propertyPerPoint;
|
| | | public readonly int promoteProperty;
|
| | | public readonly int[] promoteValue;
|
| | | public readonly Int2[] promoteProperty;
|
| | | public readonly string promoteValue;
|
| | | public readonly int[] qualityArea; |
| | | |
| | | public ReikiRootConfig() |
| | |
| | |
|
| | | Int2.TryParse(tables[1],out propertyPerPoint);
|
| | |
|
| | | int.TryParse(tables[2],out promoteProperty); |
| | |
|
| | | string[] promoteValueStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | promoteValue = new int[promoteValueStringArray.Length]; |
| | | for (int i=0;i<promoteValueStringArray.Length;i++) |
| | | string[] promotePropertyStringArray = tables[2].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | promoteProperty = new Int2[promotePropertyStringArray.Length]; |
| | | for (int i=0;i<promotePropertyStringArray.Length;i++) |
| | | { |
| | | int.TryParse(promoteValueStringArray[i],out promoteValue[i]); |
| | | Int2.TryParse(promotePropertyStringArray[i],out promoteProperty[i]); |
| | | }
|
| | |
|
| | | promoteValue = tables[3];
|
| | |
|
| | | string[] qualityAreaStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | qualityArea = new int[qualityAreaStringArray.Length]; |
| | | for (int i=0;i<qualityAreaStringArray.Length;i++) |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 98b9f6b38bc0b1841bddba5f9aa30611 |
| | | timeCreated: 1553483326 |
| | | timeCreated: 1555119994 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | public int water;//灵根属性——水
|
| | | public int fire;//灵根属性——火
|
| | | public int earth;//灵根属性——土
|
| | | public int NormalHurt;
|
| | | public int NormalHurtPer;
|
| | | public int FabaoHurt;
|
| | | public int FabaoHurtPer;
|
| | |
|
| | | public long treasurePotentialSp
|
| | | {
|
| | | get
|
| | |
| | | case PlayerDataType.CDBPlayerRefresh_Earth:
|
| | | baseData.earth = (int)value;
|
| | | break;
|
| | | case PlayerDataType.CDBPlayerRefresh_NormalHurt:
|
| | | baseData.NormalHurt = (int)value;
|
| | | break;
|
| | | case PlayerDataType.CDBPlayerRefresh_NormalHurtPer:
|
| | | baseData.NormalHurtPer = (int)value;
|
| | | break;
|
| | | case PlayerDataType.CDBPlayerRefresh_FabaoHurt:
|
| | | baseData.FabaoHurt = (int)value;
|
| | | break;
|
| | | case PlayerDataType.CDBPlayerRefresh_FabaoHurtPer:
|
| | | baseData.FabaoHurtPer = (int)value;
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | public static event SkillChangeHandler SkillChangeEvent;
|
| | |
|
| | | MountModel m_HorseModel;
|
| | | MountModel horsemodel
|
| | | {
|
| | | get
|
| | | {
|
| | | MountModel horsemodel {
|
| | | get {
|
| | | return m_HorseModel ?? (m_HorseModel = ModelCenter.Instance.GetModel<MountModel>());
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | Skill _skill = _hero.SkillMgr.Get(vNetData.NewSkillID);
|
| | | _skill.cd = vNetData.RemainTime * Constants.F_GAMMA;
|
| | | if (_skill.RefreshCD != null)
|
| | | if (Skill.RefreshCD != null)
|
| | | {
|
| | | _skill.RefreshCD(vNetData.RemainTime * Constants.F_GAMMA, _skill.skillInfo.config.CoolDownTime * Constants.F_GAMMA);
|
| | | Skill.RefreshCD(_skill.id, vNetData.RemainTime * Constants.F_GAMMA, _skill.skillInfo.config.CoolDownTime * Constants.F_GAMMA);
|
| | | }
|
| | |
|
| | | if (_skill.skillInfo.config.FuncType == 9)
|
| | |
| | | _skill.ClearServerHurtList();
|
| | | _skill.DoPreparingFail(_hero.ServerInstID);
|
| | |
|
| | | if (_skill.RefreshCD != null)
|
| | | if (Skill.RefreshCD != null)
|
| | | {
|
| | | _skill.RefreshCD(0, _skill.skillInfo.config.CoolDownTime * Constants.F_GAMMA);
|
| | | Skill.RefreshCD(_skill.id, 0, _skill.skillInfo.config.CoolDownTime * Constants.F_GAMMA);
|
| | | }
|
| | | }
|
| | | } |
| | |
| | | _Thinking(); |
| | | } |
| | | |
| | | // 是否正在释放技能 |
| | | if (m_Owner.SkillMgr.CurCastSkill != null) |
| | | { |
| | | if (m_Owner.SkillMgr.CurCastSkill.SkillCompelete == false) |
| | | { |
| | | if (m_Owner.IsIdle()) |
| | | { |
| | | m_Owner.SkillMgr.CurCastSkill.SkillCompelete = true; |
| | | } |
| | | return; |
| | | } |
| | | |
| | | if (m_Owner.SkillMgr.CurCastSkill.SkillPreparing) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (m_Owner.NextAction == GAStaticDefine.Act_Warn) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | |
| | | switch (m_AIStatus) |
| | | { |
| | | case E_AIStatus.Patrol: |
| | |
| | | GA_Hero _hero = PlayerDatas.Instance.hero; |
| | | |
| | | float _dis; |
| | | |
| | | // 是否正在释放技能 |
| | | if (m_Owner.SkillMgr.CurCastSkill != null) |
| | | { |
| | | if (m_Owner.SkillMgr.CurCastSkill.SkillCompelete == false) |
| | | { |
| | | if (m_Owner.IsIdle()) |
| | | { |
| | | m_Owner.SkillMgr.CurCastSkill.SkillCompelete = true; |
| | | } |
| | | return; |
| | | } |
| | | |
| | | if (m_Owner.SkillMgr.CurCastSkill.SkillPreparing) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (m_Owner.NextAction == GAStaticDefine.Act_Warn) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | |
| | | switch (atkStep) |
| | | { |
| | |
| | | }
|
| | | else
|
| | | {
|
| | | if (attacker is GA_NpcClientFightNorm)
|
| | | {
|
| | | if (target.ActorInfo.RealHp <= (target.ActorInfo.RealMaxHp * .5f))
|
| | | {
|
| | | hurtValue = 0;
|
| | | }
|
| | | }
|
| | |
|
| | | target.ActorInfo.ReduceHp((uint)hurtValue);
|
| | |
|
| | | if (target.ServerInstID == PlayerDatas.Instance.baseData.PlayerID)
|
| | |
| | | _aAtkSkillPer = _effectValue.value1;
|
| | | _atkSkillValue = _effectValue.value2;// 技能固定值(1010或者1009的value2)
|
| | |
|
| | | if (skill.skillInfo.config.FuncType == 1
|
| | | || skill.skillInfo.config.FuncType == 2)
|
| | | {
|
| | | _atkSkillValue += PlayerDatas.Instance.baseData.FabaoHurt;
|
| | | _aAtkSkillPer += PlayerDatas.Instance.baseData.FabaoHurtPer;
|
| | | }
|
| | | else if (skill.skillInfo.config.FuncType == 8)
|
| | | {
|
| | | _atkSkillValue += PlayerDatas.Instance.baseData.NormalHurt;
|
| | | _aAtkSkillPer += PlayerDatas.Instance.baseData.NormalHurtPer;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region 伤害衰减或者递增
|
| | |
| | |
|
| | | public static event System.Action<int> OnSkillCDFinished;
|
| | | public static event System.Action<uint, int> OnSkillCast;
|
| | | public UnityEngine.Events.UnityAction<float, float> RefreshCD;
|
| | | public static UnityEngine.Events.UnityAction<int, float, float> RefreshCD;
|
| | | public event System.Action<uint> OnPreparingEnd;
|
| | | public event System.Action<uint> OnPreparingFail;
|
| | | public event System.Action OnPreparingCast;
|
| | |
|
| | | public uint OwnerID { get; private set; }
|
| | |
|
| | | public int id
|
| | | {
|
| | | public int id {
|
| | | get; private set;
|
| | | }
|
| | |
|
| | | private float m_Cd;
|
| | | public float cd
|
| | | {
|
| | | get
|
| | | {
|
| | | public float cd {
|
| | | get {
|
| | | return m_Cd;
|
| | | }
|
| | | set
|
| | | {
|
| | | set {
|
| | | m_Cd = value;
|
| | | }
|
| | | }
|
| | |
| | | public List<Vector3> warnPosList = new List<Vector3>();// 预警时候的位置
|
| | |
|
| | | private bool m_CSkillPrepareEnd;
|
| | | public bool CSkillPrepareEnd
|
| | | {
|
| | | get
|
| | | {
|
| | | public bool CSkillPrepareEnd {
|
| | | get {
|
| | | return m_CSkillPrepareEnd;
|
| | | }
|
| | | set
|
| | | {
|
| | | set {
|
| | | m_CSkillPrepareEnd = value;
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | private E_SkillPrepareStatus m_SSkillPrepareStatus = E_SkillPrepareStatus.None;
|
| | | public E_SkillPrepareStatus SSkillPrepareStatus
|
| | | {
|
| | | get
|
| | | {
|
| | | public E_SkillPrepareStatus SSkillPrepareStatus {
|
| | | get {
|
| | | return m_SSkillPrepareStatus;
|
| | | }
|
| | | set
|
| | | {
|
| | | set {
|
| | | m_SSkillPrepareStatus = value;
|
| | | }
|
| | | }
|
| | |
|
| | | private bool m_SkillPreparing = false;
|
| | | public bool SkillPreparing
|
| | | {
|
| | | get
|
| | | {
|
| | | public bool SkillPreparing {
|
| | | get {
|
| | | return m_SkillPreparing;
|
| | | }
|
| | | set
|
| | | {
|
| | | set {
|
| | | m_SkillPreparing = value;
|
| | | }
|
| | | }
|
| | |
|
| | | private bool m_SkillCompelete = true;
|
| | | public bool SkillCompelete
|
| | | {
|
| | | get
|
| | | {
|
| | | public bool SkillCompelete {
|
| | | get {
|
| | | return m_SkillCompelete;
|
| | | }
|
| | | set
|
| | | {
|
| | | set {
|
| | | m_SkillCompelete = value;
|
| | | //if (id == 251)
|
| | | //{
|
| | |
| | | {
|
| | | if (RefreshCD != null)
|
| | | {
|
| | | RefreshCD(cd, cd);
|
| | | RefreshCD(id, cd, cd);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | cd = skillInfo.config.CoolDownTime * Constants.F_GAMMA;
|
| | | if (RefreshCD != null)
|
| | | {
|
| | | RefreshCD(cd, cd);
|
| | | RefreshCD(id,cd, cd);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | && _skill.skillInfo != null
|
| | | && _skill.skillInfo.config != null)
|
| | | {
|
| | | if (_skill.RefreshCD != null)
|
| | | if ( Skill.RefreshCD != null)
|
| | | {
|
| | | _skill.cd = 0;
|
| | | _skill.RefreshCD(0, _skill.skillInfo.config.CoolDownTime * Constants.F_GAMMA);
|
| | | Skill.RefreshCD( _skill.id,0, _skill.skillInfo.config.CoolDownTime * Constants.F_GAMMA);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | [XLua.LuaCallCSharp]
|
| | | public class StatusMgr : SingletonMonobehaviour<StatusMgr>
|
| | |
|
| | | {
|
| | | public static event UnityAction<int> OnGainStatus;
|
| | | public static event UnityAction<float> OnGainCantCastSkillStatus;
|
| | | public static event UnityAction OnReleaseCantCastSkillStatus;
|
| | | public static event UnityAction<int> onReceiveStatus;
|
| | |
|
| | | private Dictionary<uint, List<Status_Base>> m_StatusDict = null;
|
| | |
| | | OnGainStatus(h0605.SkillID);
|
| | | }
|
| | | }
|
| | |
|
| | | if (!_status.CanUseSkill())
|
| | | {
|
| | | if (OnGainCantCastSkillStatus != null)
|
| | | {
|
| | | OnGainCantCastSkillStatus(h0605.LastTime * Constants.F_DELTA);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (onReceiveStatus != null)
|
| | | {
|
| | | onReceiveStatus(h0605.SkillID);
|
| | | }
|
| | | }
|
| | |
|
| | | public bool CanCastSkill(uint sid)
|
| | | {
|
| | | List<Status_Base> _list = null;
|
| | | if (m_StatusDict.TryGetValue(sid, out _list))
|
| | | {
|
| | | SkillHelper.SkillInfo _skillInfo = null;
|
| | | for (int i = 0; i < _list.Count; ++i)
|
| | | {
|
| | | _skillInfo = SkillHelper.Instance.Get(_list[i].h0605.SkillID);
|
| | | if (_skillInfo.config.ClientSkillSeriesLimit == 0
|
| | | || (_skillInfo.config.ClientSkillSeriesLimit & 2) == 0)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public void Release(uint objID, byte type)
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (!_status.CanUseSkill())
|
| | | {
|
| | | if (_actor is GA_Hero)
|
| | | {
|
| | | if (OnReleaseCantCastSkillStatus != null)
|
| | | {
|
| | | OnReleaseCantCastSkillStatus();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | _status.UnInit(h0606.ObjID, h0606.BuffType);
|
| | |
|
| | | if (m_AllStatus.Contains(_status))
|
| | |
| | | return (m_SkillConfig.ClientSkillSeriesLimit & skillSeries) == 0;
|
| | | }
|
| | |
|
| | | public bool CanUseSkill()
|
| | | {
|
| | | return m_SkillConfig.ClientSkillSeriesLimit == 0
|
| | | || (m_SkillConfig.ClientSkillSeriesLimit & 2) == 0;
|
| | | }
|
| | | }
|
| | |
| | | else |
| | | { |
| | | if (!ClientDungeonStageUtility.isClientDungeon |
| | | && !ClientSceneManager.Instance.IsClientFightMode |
| | | #if UNITY_EDITOR |
| | | && !RuntimeLogUtility.TEST_CLIENT_PVP |
| | | #endif |
| | |
| | | |
| | | // 如果处于客户端战斗则不进行血量矫正了 |
| | | if (!ClientDungeonStageUtility.isClientDungeon |
| | | && !ClientSceneManager.Instance.IsClientFightMode |
| | | #if UNITY_EDITOR |
| | | && !RuntimeLogUtility.TEST_CLIENT_PVP |
| | | #endif |
| | |
| | | |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "id", _g_get_id); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "propertyPerPoint", _g_get_propertyPerPoint); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "promoteProperty", _g_get_promoteProperty); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "promoteValue", _g_get_promoteValue); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "qualityArea", _g_get_qualityArea); |
| | | |
| | |
| | | |
| | | ReikiRootConfig gen_to_be_invoked = (ReikiRootConfig)translator.FastGetCSObj(L, 1); |
| | | translator.Push(L, gen_to_be_invoked.propertyPerPoint); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_promoteProperty(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | ReikiRootConfig gen_to_be_invoked = (ReikiRootConfig)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.promoteProperty); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "currentActiveValue", _g_get_currentActiveValue); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "everyDayRedpoint", _g_get_everyDayRedpoint); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "timeLimitRedpoint", _g_get_timeLimitRedpoint); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "trialExchangeRedpoint", _g_get_trialExchangeRedpoint); |
| | | |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "currentDailyQuest", _s_set_currentDailyQuest); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "everyDayRedpoint", _s_set_everyDayRedpoint); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "timeLimitRedpoint", _s_set_timeLimitRedpoint); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "trialExchangeRedpoint", _s_set_trialExchangeRedpoint); |
| | | |
| | | |
| | | Utils.EndObjectRegister(type, L, translator, null, null, |
| | |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_trialExchangeRedpoint(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.DailyQuestModel gen_to_be_invoked = (Snxxz.UI.DailyQuestModel)translator.FastGetCSObj(L, 1); |
| | | translator.Push(L, gen_to_be_invoked.trialExchangeRedpoint); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_currentDailyQuest(RealStatePtr L) |
| | |
| | | return 0; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_trialExchangeRedpoint(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.DailyQuestModel gen_to_be_invoked = (Snxxz.UI.DailyQuestModel)translator.FastGetCSObj(L, 1); |
| | | gen_to_be_invoked.trialExchangeRedpoint = (Snxxz.UI.Redpoint)translator.GetObject(L, 2, typeof(Snxxz.UI.Redpoint)); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _e_activeValueRewardGotEvent(RealStatePtr L) |
| | | { |
| | |
| | | |
| | | { |
| | | |
| | | int gen_ret = gen_to_be_invoked.GetLatestUnLockBoss( ); |
| | | int gen_ret = gen_to_be_invoked.GetRecommendBoss( ); |
| | | LuaAPI.xlua_pushinteger(L, gen_ret); |
| | | |
| | | |
| | |
| | | }
|
| | | else
|
| | | {
|
| | | Clock.Create(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), GetAssetVersionFile);
|
| | | Clock.AlarmAt(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), GetAssetVersionFile);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | var endTime = DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond * 3);
|
| | | if (netSwitchClock != null)
|
| | | {
|
| | | netSwitchClock.Stop();
|
| | | Clock.Stop(netSwitchClock);
|
| | | }
|
| | | netSwitchClock = Clock.Create(endTime, () =>
|
| | |
|
| | | netSwitchClock = Clock.AlarmAt(endTime, () =>
|
| | | {
|
| | | if (CheckDominantDownLoad())
|
| | | {
|
| | |
| | | {
|
| | | Pause();
|
| | | var endTime = DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond * 10);
|
| | | Clock.Create(endTime, () =>
|
| | | Clock.AlarmAt(endTime, () =>
|
| | | {
|
| | | if (CheckDominantDownLoad())
|
| | | {
|
| | |
| | | else
|
| | | {
|
| | | step = Step.None;
|
| | | Clock.Create(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), RequestVersionCheck);
|
| | | Clock.AlarmAt(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), RequestVersionCheck);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | Clock.Create(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), RequestApkDownConfigs);
|
| | | Clock.AlarmAt(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), RequestApkDownConfigs);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | else
|
| | | {
|
| | | step = Step.None;
|
| | | Clock.Create(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), RequestMaoErVersionCheck);
|
| | | Clock.AlarmAt(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), RequestMaoErVersionCheck);
|
| | | }
|
| | | }
|
| | | catch (System.Exception ex)
|
| | | {
|
| | | Debug.Log(ex);
|
| | | step = Step.None;
|
| | | Clock.Create(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), RequestMaoErVersionCheck);
|
| | | Clock.AlarmAt(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), RequestMaoErVersionCheck);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | step = Step.None;
|
| | | Clock.Create(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), RequestMaoErVersionCheck);
|
| | | Clock.AlarmAt(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), RequestMaoErVersionCheck);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | [SerializeField] ImageEx m_ImageGoto; |
| | | [SerializeField] Button m_KillRecord; |
| | | [SerializeField] Transform m_SurpassLevel; |
| | | [SerializeField] RectTransform m_NoDamageTip; |
| | | [SerializeField] ToggleButton m_Subscribe; |
| | | |
| | | [SerializeField] RectTransform m_ContainerBoxCollectWeary; |
| | |
| | | |
| | | CrossServerBossModel model { get { return ModelCenter.Instance.GetModel<CrossServerBossModel>(); } } |
| | | FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } } |
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } } |
| | | BossHomeModel bossHomeModel { get { return ModelCenter.Instance.GetModel<BossHomeModel>(); } } |
| | | |
| | | #region Built-in |
| | | protected override void BindController() |
| | |
| | | |
| | | DisplayItemDropTip(model.selectedBoss); |
| | | DisplayBossBaseInfo(model.selectedBoss); |
| | | DisplayWearyValue(model.selectedBoss); |
| | | DisplayTimes(model.selectedBoss); |
| | | } |
| | | |
| | | private void ShowKillRecords() |
| | |
| | | { |
| | | DisplayItemDropTip(_bossId); |
| | | DisplayBossBaseInfo(_bossId); |
| | | DisplayWearyValue(_bossId); |
| | | DisplayTimes(_bossId); |
| | | } |
| | | |
| | | private void DisplayBossBaseInfo(int _bossId) |
| | |
| | | } |
| | | } |
| | | |
| | | private void DisplayItemDropTip(int _bossId) |
| | | private void DisplayItemDropTip(int bossId) |
| | | { |
| | | var config = CrossServerBossConfig.Get(model.selectedBoss); |
| | | var config = CrossServerBossConfig.Get(bossId); |
| | | switch (config.MonsterType) |
| | | { |
| | | case 1: |
| | | case 2: |
| | | case 3: |
| | | m_NoDamageTip.gameObject.SetActive(true); |
| | | m_SurpassLevel.gameObject.SetActive(false); |
| | | break; |
| | | case 4: |
| | | var npcDropConfig = NPCDropItemConfig.Get(_bossId); |
| | | m_SurpassLevel.gameObject.SetActive(npcDropConfig.MaxLV != 0 && PlayerDatas.Instance.baseData.LV > npcDropConfig.MaxLV); |
| | | var realmLevel = PlayerDatas.Instance.baseData.realmLevel; |
| | | var npcConfig = NPCConfig.Get(bossId); |
| | | |
| | | if (npcConfig.Realm > realmLevel) |
| | | { |
| | | m_NoDamageTip.gameObject.SetActive(true); |
| | | m_SurpassLevel.gameObject.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | m_NoDamageTip.gameObject.SetActive(false); |
| | | var dropConfig = NPCDropItemConfig.Get(bossId); |
| | | var noDrop = dropConfig == null || (dropConfig.MaxLV != 0 && PlayerDatas.Instance.baseData.LV > dropConfig.MaxLV); |
| | | m_SurpassLevel.gameObject.SetActive(noDrop); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | | private void DisplayWearyValue(int _bossId) |
| | | private void DisplayTimes(int bossId) |
| | | { |
| | | var config = CrossServerBossConfig.Get(model.selectedBoss); |
| | | var config = CrossServerBossConfig.Get(bossId); |
| | | switch (config.MonsterType) |
| | | { |
| | | case 1: |
| | |
| | |
|
| | | showing = true;
|
| | | this.enabled = false;
|
| | | Clock.Create(DateTime.Now + new TimeSpan((long)(0.5f * TimeSpan.TicksPerSecond)), OnUnfoldShowEnd);
|
| | | Clock.AlarmAt(DateTime.Now + new TimeSpan((long)(0.5f * TimeSpan.TicksPerSecond)), OnUnfoldShowEnd);
|
| | | }
|
| | |
|
| | | private void OnUnfoldShowEnd()
|
| | |
| | | showAchievementBehaviour.alphaTween.SetStartState();
|
| | | showAchievementBehaviour.alphaTween.Play();
|
| | | var endTime = DateTime.Now + new TimeSpan((long)(fadeOutTime * TimeSpan.TicksPerSecond));
|
| | | Clock.Create(endTime, ReLocateItems);
|
| | | Clock.AlarmAt(endTime, ReLocateItems);
|
| | | }
|
| | |
|
| | | void ReLocateItems()
|
| | |
| | | ReLocateAllItems(showAchievementBehaviour);
|
| | |
|
| | | var endTime = DateTime.Now + new TimeSpan((long)(relocationTime * TimeSpan.TicksPerSecond));
|
| | | Clock.Create(endTime, ShowEnd);
|
| | | Clock.AlarmAt(endTime, ShowEnd);
|
| | | }
|
| | |
|
| | | void ShowEnd()
|
| | |
| | | public void OnSwitchAccount()
|
| | | {
|
| | | IsMatching = false;
|
| | | if (clientMatchClock!=null )
|
| | |
|
| | | if (clientMatchClock != null)
|
| | | {
|
| | | clientMatchClock.Stop();
|
| | | Clock.Stop(clientMatchClock);
|
| | | clientMatchClock = null;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | var onMatchPackage = new HC002_tagGCCrossRealmPKStartMatch();
|
| | | GameNetSystem.Instance.PushPackage(onMatchPackage, ServerType.Main);
|
| | | var randomWaitSeconds = UnityEngine.Random.Range(3, 8);
|
| | | clientMatchClock = Clock.Create(DateTime.Now + new TimeSpan(randomWaitSeconds * TimeSpan.TicksPerSecond), () =>
|
| | | clientMatchClock = Clock.AlarmAt(DateTime.Now + new TimeSpan(randomWaitSeconds * TimeSpan.TicksPerSecond), () =>
|
| | | {
|
| | | IsMatching = false;
|
| | | if (GameNetSystem.Instance.netState == GameNetSystem.NetState.Connected)
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | if (clientMatchClock != null && !clientMatchClock.stopped)
|
| | | if (clientMatchClock != null )
|
| | | {
|
| | | clientMatchClock.Stop();
|
| | | Clock.Stop(clientMatchClock);
|
| | | clientMatchClock = null;
|
| | | IsMatching = false;
|
| | | }
|
| | | else
|
| | |
| | |
|
| | | public void SendBuyMatchCount()
|
| | | {
|
| | | CC102_tagCMCrossRealmPKBuy pKBuy = new CC102_tagCMCrossRealmPKBuy();
|
| | | var pKBuy = new CC102_tagCMCrossRealmPKBuy();
|
| | | GameNetSystem.Instance.SendInfo(pKBuy);
|
| | | }
|
| | |
|
| | |
| | |
|
| | | switch ((DailyQuestType)data.id)
|
| | | {
|
| | | case DailyQuestType.Trial:
|
| | | m_FuncRedpointBehaviour.redpointId = model.trialExchangeRedpoint.id;
|
| | | break;
|
| | | default:
|
| | | m_FuncRedpointBehaviour.redpointId = 0;
|
| | | break;
|
| | |
| | |
|
| | | switch ((DailyQuestType)data.id)
|
| | | {
|
| | | case DailyQuestType.Trial:
|
| | | m_Func.gameObject.SetActive(state != DailyQuestModel.DailyQuestState.Locked);
|
| | | m_FuncDisplay.text = Language.Get("ItemHandle_exchange");
|
| | | break;
|
| | | case DailyQuestType.DungeonAssist:
|
| | | m_Func.gameObject.SetActive(false);
|
| | | m_Complete.gameObject.SetActive(false);
|
| | |
| | | public Redpoint timeLimitRedpoint = new Redpoint(DAILYQUEST_REDPOINTID, TIMELIMIT_REDPOINTID);
|
| | | Redpoint activeValueRedpoint = new Redpoint(EVERYDAY_REDPOINTID, ACTIVEVALUE_REDPOINT);
|
| | | Redpoint realmPointRedpoint = new Redpoint(EVERYDAY_REDPOINTID, REALMPOINT_REPOINT);
|
| | | public Redpoint trialExchangeRedpoint = new Redpoint(EVERYDAY_REDPOINTID, TRIALEXCHANGE_REDPOINTID);
|
| | |
|
| | | int m_DailyQuestTotalActiveValue = 150;
|
| | | public int dailyQuestTotalActiveValue {
|
| | |
| | | break;
|
| | | case DailyQuestType.ElderGodArea:
|
| | | WindowCenter.Instance.Close<DailyQuestWin>();
|
| | | WindowCenter.Instance.Open<FindPreciousFrameWin>(false, 3);
|
| | | WindowCenter.Instance.Open<FindPreciousFrameWin>(false, 4);
|
| | | break;
|
| | | case DailyQuestType.RuneTower:
|
| | | WindowCenter.Instance.Close<DailyQuestWin>();
|
| | |
| | | [SerializeField] ImageEx m_ImageGoto; |
| | | [SerializeField] Button m_KillRecord; |
| | | [SerializeField] Transform m_SurpassLevel; |
| | | [SerializeField] RectTransform m_NoDamageTip; |
| | | [SerializeField] ToggleButton m_Subscribe; |
| | | |
| | | [SerializeField] RectTransform m_ContainerBoxCollectWeary; |
| | |
| | | |
| | | DisplayItemDropTip(model.selectedBoss); |
| | | DisplayBossBaseInfo(model.selectedBoss); |
| | | DisplayWearyValue(model.selectedBoss); |
| | | DisplaySkillTimes(model.selectedBoss); |
| | | } |
| | | |
| | | private void ShowKillRecords() |
| | |
| | | { |
| | | DisplayItemDropTip(_bossId); |
| | | DisplayBossBaseInfo(_bossId); |
| | | DisplayWearyValue(_bossId); |
| | | DisplaySkillTimes(_bossId); |
| | | } |
| | | |
| | | private void DisplayBossBaseInfo(int _bossId) |
| | |
| | | } |
| | | } |
| | | |
| | | private void DisplayItemDropTip(int _bossId) |
| | | private void DisplayItemDropTip(int bossId) |
| | | { |
| | | var config = DogzDungeonConfig.Get(model.selectedBoss); |
| | | var config = DogzDungeonConfig.Get(bossId); |
| | | switch (config.MonsterType) |
| | | { |
| | | case 1: |
| | | case 2: |
| | | case 3: |
| | | m_NoDamageTip.gameObject.SetActive(true); |
| | | m_SurpassLevel.gameObject.SetActive(false); |
| | | break; |
| | | case 4: |
| | | var npcDropConfig = NPCDropItemConfig.Get(_bossId); |
| | | m_SurpassLevel.gameObject.SetActive(npcDropConfig.MaxLV != 0 && PlayerDatas.Instance.baseData.LV > npcDropConfig.MaxLV); |
| | | var realmLevel = PlayerDatas.Instance.baseData.realmLevel; |
| | | var npcConfig = NPCConfig.Get(bossId); |
| | | |
| | | if (npcConfig.Realm > realmLevel) |
| | | { |
| | | m_NoDamageTip.gameObject.SetActive(true); |
| | | m_SurpassLevel.gameObject.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | m_NoDamageTip.gameObject.SetActive(false); |
| | | var dropConfig = NPCDropItemConfig.Get(bossId); |
| | | var noDrop = dropConfig == null || (dropConfig.MaxLV != 0 && PlayerDatas.Instance.baseData.LV > dropConfig.MaxLV); |
| | | m_SurpassLevel.gameObject.SetActive(noDrop); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | | private void DisplayWearyValue(int _bossId) |
| | | private void DisplaySkillTimes(int _bossId) |
| | | { |
| | | var config = DogzDungeonConfig.Get(model.selectedBoss); |
| | | switch (config.MonsterType) |
| | |
| | | if (ok)
|
| | | {
|
| | | teamModel.RequestExitTeam();
|
| | | Clock.Create(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond),
|
| | | Clock.AlarmAt(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond),
|
| | | () =>
|
| | | {
|
| | | m_CurrentDungeon = _dungeon;
|
| | |
| | |
|
| | | if (_type == DungeonCoolDownType.WaitStart)
|
| | | {
|
| | | Clock.Create(dungeonCoolDowns[_type], OnBeginCoolDownEnd);
|
| | | Clock.AlarmAt(dungeonCoolDowns[_type], OnBeginCoolDownEnd);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | if (_ok)
|
| | | {
|
| | | teamModel.RequestExitTeam();
|
| | | Clock.Create(DateTime.Now + new TimeSpan(1 * TimeSpan.TicksPerSecond),
|
| | | Clock.AlarmAt(DateTime.Now + new TimeSpan(1 * TimeSpan.TicksPerSecond),
|
| | | () =>
|
| | | {
|
| | | OpenDungeonSuppliesLack(_dungeon);
|
| | |
| | | error = 1;
|
| | | return false;
|
| | | }
|
| | | if (!NewBieCenter.Instance.completeGuidesBuf.Contains(TRIALEXCHANGE_GUIDE))
|
| | | {
|
| | | NewBieCenter.Instance.RemoveNewBieGuide(TRIALEXCHANGE_GUIDE);
|
| | | }
|
| | | //if (!NewBieCenter.Instance.completeGuidesBuf.Contains(TRIALEXCHANGE_GUIDE))
|
| | | //{
|
| | | // NewBieCenter.Instance.RemoveNewBieGuide(TRIALEXCHANGE_GUIDE);
|
| | | //}
|
| | | //var tokenConfig = ItemConfig.Get(config.tokenId);
|
| | | //ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),
|
| | | // Language.Get("TokenUseConfirm", config.tokenCount, tokenConfig.ItemName, config.description), (bool isOk) =>
|
| | |
| | | #region 红点
|
| | | void UpdateRedpoint()
|
| | | {
|
| | | dailyQuestModel.trialExchangeRedpoint.state = RedPointState.None;
|
| | | if (!FuncOpen.Instance.IsFuncOpen(88) ||
|
| | | PlayerDatas.Instance.baseData.LV >= trialExchangeRemindLevel)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var maxClass = 0;
|
| | | if (TryGetSatisfyExchange(out maxClass))
|
| | | {
|
| | | dailyQuestModel.trialExchangeRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | | //dailyQuestModel.trialExchangeRedpoint.state = RedPointState.None;
|
| | | //if (!FuncOpen.Instance.IsFuncOpen(88) ||
|
| | | // PlayerDatas.Instance.baseData.LV >= trialExchangeRemindLevel)
|
| | | //{
|
| | | // return;
|
| | | //}
|
| | | //var maxClass = 0;
|
| | | //if (TryGetSatisfyExchange(out maxClass))
|
| | | //{
|
| | | // dailyQuestModel.trialExchangeRedpoint.state = RedPointState.Simple;
|
| | | //}
|
| | | }
|
| | |
|
| | | public bool TryGetSatisfyExchange(out int maxClass)
|
| | |
| | |
|
| | | public bool IsAnySatisfyExchangeBetter(int _itemId)
|
| | | {
|
| | | return false;
|
| | | if (PlayerDatas.Instance.baseData.LV >= trialExchangeRemindLevel)
|
| | | {
|
| | | return false;
|
| | |
| | | Button m_Close;
|
| | | [SerializeField]
|
| | | Text trialChallengeCntTxt;
|
| | | [SerializeField] Button m_Exchange;
|
| | |
|
| | | public event Action<Dungeon> dungeonSelectEvent;
|
| | | Dungeon m_CurrentSelectDungeon;
|
| | |
| | | {
|
| | | //m_Confirm.AddListener(ChallengeDungeon);
|
| | | m_Close.AddListener(CloseClick);
|
| | | m_Exchange.AddListener(Exchange);
|
| | | //m_Exchange.AddListener(Exchange);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | |
| | | TextColType.Red : TextColType.NavyBrown, completedTimes.ToString(), true), totalTimes);
|
| | | }
|
| | |
|
| | | private void Exchange()
|
| | | {
|
| | | if (!trialDungeonModel.CompleteTrialFloor(0))
|
| | | {
|
| | | trialDungeonModel.ProcessOpenTrialExchangeError();
|
| | | return;
|
| | | }
|
| | | WindowCenter.Instance.Open<TrialExchangeWin>();
|
| | | }
|
| | | //private void Exchange()
|
| | | //{
|
| | | // if (!trialDungeonModel.CompleteTrialFloor(0))
|
| | | // {
|
| | | // trialDungeonModel.ProcessOpenTrialExchangeError();
|
| | | // return;
|
| | | // }
|
| | | // WindowCenter.Instance.Open<TrialExchangeWin>();
|
| | | //}
|
| | |
|
| | | }
|
| | |
|
| | |
| | | [SerializeField] Button m_Goto;
|
| | | [SerializeField] Button m_KillRecord;
|
| | | [SerializeField] Transform m_SurpassLevel;
|
| | | [SerializeField] RectTransform m_NoDamageTip;
|
| | | [SerializeField] ToggleButton m_Subscribe;
|
| | |
|
| | | BossHomeModel model { get { return ModelCenter.Instance.GetModel<BossHomeModel>(); } }
|
| | | FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } }
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | |
| | | break;
|
| | | }
|
| | |
|
| | | var npcDropConfig = NPCDropItemConfig.Get(model.selectedBoss);
|
| | | m_SurpassLevel.gameObject.SetActive(npcDropConfig.MaxLV != 0 && PlayerDatas.Instance.baseData.LV > npcDropConfig.MaxLV);
|
| | | DisplayTip(model.selectedBoss);
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | yield return WaitingForSecondConst.WaitMS300;
|
| | | var bossId = model.selectedBoss;
|
| | | var config = BossHomeConfig.Get(bossId);
|
| | | var npcDropConfig = NPCDropItemConfig.Get(bossId);
|
| | | m_SurpassLevel.gameObject.SetActive(npcDropConfig.MaxLV != 0 && PlayerDatas.Instance.baseData.LV > npcDropConfig.MaxLV);
|
| | |
|
| | | DisplayTip(model.selectedBoss);
|
| | |
|
| | | switch (config.MonsterType)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void DisplayTip(int bossId)
|
| | | {
|
| | | var realmLevel = PlayerDatas.Instance.baseData.realmLevel;
|
| | | var config = NPCConfig.Get(bossId);
|
| | |
|
| | | if (config.Realm > realmLevel)
|
| | | {
|
| | | m_NoDamageTip.gameObject.SetActive(true);
|
| | | m_SurpassLevel.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_NoDamageTip.gameObject.SetActive(false);
|
| | | var dropConfig = NPCDropItemConfig.Get(bossId);
|
| | | var noDrop = dropConfig == null || (dropConfig.MaxLV != 0 && PlayerDatas.Instance.baseData.LV > dropConfig.MaxLV);
|
| | | m_SurpassLevel.gameObject.SetActive(noDrop);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
| | | [SerializeField] TimerBehaviour m_CountRemainTime;
|
| | | [SerializeField] Button m_Goto;
|
| | | [SerializeField] Transform m_SurpassLevel;
|
| | | [SerializeField] RectTransform m_NoDamageTip;
|
| | | [SerializeField] ToggleButton m_Subscribe;
|
| | |
|
| | | [SerializeField] RectTransform m_ContainerDouble;
|
| | |
| | |
|
| | | DemonJarBossData bossData;
|
| | | model.TryGetBossData(model.selectedBoss, out bossData);
|
| | | var npcDropConfig = NPCDropItemConfig.Get(bossData.id);
|
| | | m_SurpassLevel.gameObject.SetActive(npcDropConfig.MaxLV != 0 && PlayerDatas.Instance.baseData.LV > npcDropConfig.MaxLV);
|
| | | m_Subscribe.isOn = findPreciousModel.IsBossSubscribed(model.selectedBoss);
|
| | |
|
| | | m_BossIntroduce.Display(model.selectedBoss, true);
|
| | | m_Bosses.Init(bosses);
|
| | | m_Bosses.MoveToCenter(bosses.IndexOf(model.selectedBoss));
|
| | |
|
| | | DisplayTip(model.selectedBoss);
|
| | | }
|
| | |
|
| | | private void ShowSkillRecord()
|
| | |
| | | return true;
|
| | | }
|
| | |
|
| | | private void OnBossSelected(int _bossId)
|
| | | private void OnBossSelected(int bossId)
|
| | | {
|
| | | m_BossIntroduce.Display(_bossId, false);
|
| | | m_Subscribe.isOn = findPreciousModel.IsBossSubscribed(_bossId);
|
| | | m_BossIntroduce.Display(bossId, false);
|
| | | m_Subscribe.isOn = findPreciousModel.IsBossSubscribed(bossId);
|
| | |
|
| | | DemonJarBossData bossData;
|
| | | model.TryGetBossData(_bossId, out bossData);
|
| | | var npcDropConfig = NPCDropItemConfig.Get(bossData.id);
|
| | | m_SurpassLevel.gameObject.SetActive(npcDropConfig.MaxLV != 0 && PlayerDatas.Instance.baseData.LV > npcDropConfig.MaxLV);
|
| | | model.TryGetBossData(bossId, out bossData);
|
| | |
|
| | | var demonJarConfig = DemonJarConfig.Get(model.selectedBoss);
|
| | | m_RewardDescription.text = Language.Get(demonJarConfig.RewardDescription);
|
| | | var config = DemonJarConfig.Get(model.selectedBoss);
|
| | | m_RewardDescription.text = Language.Get(config.RewardDescription);
|
| | |
|
| | | DisplayTip(bossId);
|
| | | DisplayAutoAndDoubleTitle();
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void DisplayTip(int bossId)
|
| | | {
|
| | | var realmLevel = PlayerDatas.Instance.baseData.realmLevel;
|
| | | var config = NPCConfig.Get(bossId);
|
| | |
|
| | | if (config.Realm > realmLevel)
|
| | | {
|
| | | m_NoDamageTip.gameObject.SetActive(true);
|
| | | m_SurpassLevel.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_NoDamageTip.gameObject.SetActive(false);
|
| | | var dropConfig = NPCDropItemConfig.Get(bossId);
|
| | | var noDrop = dropConfig == null || (dropConfig.MaxLV != 0 && PlayerDatas.Instance.baseData.LV > dropConfig.MaxLV);
|
| | | m_SurpassLevel.gameObject.SetActive(noDrop);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | [SerializeField] Button m_Goto;
|
| | | [SerializeField] Button m_KillRecord;
|
| | | [SerializeField] ToggleButton m_Subscribe;
|
| | | [SerializeField] RectTransform m_NoDamageTip;
|
| | |
|
| | | ElderGodAreaModel model { get { return ModelCenter.Instance.GetModel<ElderGodAreaModel>(); } }
|
| | | FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } }
|
| | |
| | | m_Subscribe.isOn = findPreciousModel.IsBossSubscribed(model.selectedBoss);
|
| | | m_Bosses.Init(bosses);
|
| | | m_Bosses.MoveToCenter(bosses.IndexOf(model.selectedBoss));
|
| | |
|
| | | DisplayTip(model.selectedBoss);
|
| | | }
|
| | |
|
| | | private void ShowKillRecords()
|
| | |
| | | m_Subscribe.isOn = findPreciousModel.IsBossSubscribed(model.selectedBoss);
|
| | | }
|
| | |
|
| | | private void OnBossSelected(int _bossId)
|
| | | private void OnBossSelected(int bossId)
|
| | | {
|
| | | StopCoroutine("Co_DelayDisplayNpcBaseInfo");
|
| | | StartCoroutine("Co_DelayDisplayNpcBaseInfo");
|
| | | m_Subscribe.isOn = findPreciousModel.IsBossSubscribed(_bossId);
|
| | | m_Subscribe.isOn = findPreciousModel.IsBossSubscribed(bossId);
|
| | |
|
| | | DisplayTip(bossId);
|
| | | }
|
| | |
|
| | | private void DisplayNpcBaseInfo(bool immediately)
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void DisplayTip(int bossId)
|
| | | {
|
| | | var realmLevel = PlayerDatas.Instance.baseData.realmLevel;
|
| | | var config = NPCConfig.Get(bossId);
|
| | |
|
| | | if (config.Realm > realmLevel)
|
| | | {
|
| | | m_NoDamageTip.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_NoDamageTip.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | [SerializeField] Button m_Close;
|
| | |
|
| | | float timer = 0f;
|
| | | MapModel mapModel { get { return ModelCenter.Instance.GetModel<MapModel>(); } }
|
| | | FindPreciousModel model { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | DemonJarModel demonJarModel { get { return ModelCenter.Instance.GetModel<DemonJarModel>(); } }
|
| | | BossHomeModel bossHomeModel { get { return ModelCenter.Instance.GetModel<BossHomeModel>(); } }
|
| | | DogzDungeonModel dogzDungeonModel { get { return ModelCenter.Instance.GetModel<DogzDungeonModel>(); } }
|
| | | CrossServerBossModel crossServerBossModel { get { return ModelCenter.Instance.GetModel<CrossServerBossModel>(); } }
|
| | |
|
| | | private void OnEnable()
|
| | |
| | | if (model.currentBossNotify != default(FindPreciousModel.BossNotify))
|
| | | {
|
| | | var bossId = model.currentBossNotify.bossId;
|
| | | var type = model.GetBossFindPreciousType(bossId);
|
| | |
|
| | | m_ContainerBossReborn.gameObject.SetActive(true);
|
| | | var config = NPCConfig.Get(bossId);
|
| | |
| | |
|
| | | private void GotoKillBoss()
|
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var bossId = model.currentBossNotify.bossId;
|
| | | var type = model.GetBossFindPreciousType(bossId);
|
| | |
|
| | |
| | | if (mapConfig.MapFBType == (int)MapType.OpenCountry)
|
| | | {
|
| | | WindowCenter.Instance.Close<MainInterfaceWin>();
|
| | | var demonJarModel = ModelCenter.Instance.GetModel<DemonJarModel>();
|
| | | demonJarModel.selectedBoss = _bossId;
|
| | | demonJarModel.lockSelectedBoss = true;
|
| | | WindowCenter.Instance.Open<LootPreciousFrameWin>(false, 0);
|
| | | WindowCenter.Instance.Open<FindPreciousFrameWin>(false, 3);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | public class FindPreciousFrameWin : Window
|
| | | {
|
| | | [SerializeField] FunctionButtonGroup m_FunctionGroup;
|
| | | [SerializeField] FunctionButton m_DemonJar;
|
| | | [SerializeField] FunctionButton m_WorldBoss;
|
| | | [SerializeField] FunctionButton m_BossHome;
|
| | | [SerializeField] FunctionButton m_PersonalBoss;
|
| | |
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_DemonJar.AddListener(ShowDemonJar);
|
| | | m_WorldBoss.AddListener(ShowWorldBoss);
|
| | | m_BossHome.AddListener(ShowBossHome);
|
| | | m_PersonalBoss.AddListener(ShowPersonalBoss);
|
| | |
| | | m_Right.gameObject.SetActive(m_FunctionGroup.unLockedCount > 1);
|
| | |
|
| | | m_FunctionGroup.TriggerByOrder(functionOrder);
|
| | | m_FunctionGroup.GotoOrder(functionOrder);
|
| | | }
|
| | | #endregion
|
| | |
|
| | | private void ShowDemonJar() |
| | | { |
| | | CloseSubWindows();
|
| | | WindowCenter.Instance.Open<DemonJarWin>(); |
| | | functionOrder = m_DemonJar.order; |
| | | }
|
| | |
|
| | | private void ShowWorldBoss()
|
| | | {
|
| | |
| | |
|
| | | private void CloseSubWindows()
|
| | | {
|
| | | WindowCenter.Instance.Close<WorldBossWin>();
|
| | | WindowCenter.Instance.Close<BossHomeWin>();
|
| | | WindowCenter.Instance.Close<PersonalBossWin>();
|
| | | WindowCenter.Instance.Close<ElderGodAreaWin>();
|
| | | WindowCenter.Instance.Close<PreciousDropRecordWin>();
|
| | | var subWindows = WindowConfig.Get().FindChildWindows("FindPreciousFrameWin");
|
| | | foreach ( var window in subWindows )
|
| | | {
|
| | | WindowCenter.Instance.Close(window);
|
| | | }
|
| | | }
|
| | |
|
| | | private void ShowLastFunction()
|
| | |
| | | Redpoint lootPreciousRedpoint = new Redpoint(LOOTPRECIOUs_REDPOINTID);
|
| | |
|
| | | int m_ViewKillRecordsBoss = 0;
|
| | | public int ViewKillRecordsBoss
|
| | | {
|
| | | public int ViewKillRecordsBoss {
|
| | | get { return this.m_ViewKillRecordsBoss; }
|
| | | set { this.m_ViewKillRecordsBoss = value; }
|
| | | }
|
| | |
| | | public List<BossNotify> bossNotifies = new List<BossNotify>();
|
| | |
|
| | | BossNotify m_CurrentBossNotify = default(BossNotify);
|
| | | public BossNotify currentBossNotify
|
| | | {
|
| | | public BossNotify currentBossNotify {
|
| | | get { return m_CurrentBossNotify; }
|
| | | private set
|
| | | {
|
| | | private set {
|
| | | if (m_CurrentBossNotify != value)
|
| | | {
|
| | | m_CurrentBossNotify = value;
|
| | |
| | | private void UpdateRedpoint(int _redpointId)
|
| | | {
|
| | | if (_redpointId == WorldBossModel.WORLDBOSS_REDPOINT ||
|
| | | _redpointId == PersonalBossModel.PERSONAL_REDPOINTID)
|
| | | _redpointId == PersonalBossModel.PERSONAL_REDPOINTID ||
|
| | | _redpointId == DemonJarModel.DEMONJAR_REDPOINTID
|
| | | )
|
| | | {
|
| | | var worldBossRedpointCount = worldBossModel.worldBossRedPoint.count;
|
| | | var personalBossRedpointCount = personalBossModel.personalRedpoint.count;
|
| | | var totalCount = worldBossRedpointCount + personalBossRedpointCount;
|
| | | var demonJarRedpointCount = demonJarModel.redpoint.count;
|
| | |
|
| | | var totalCount = worldBossRedpointCount + personalBossRedpointCount + demonJarRedpointCount;
|
| | | findPreciousRedpoint.state = totalCount > 0 ? RedPointState.Quantity : RedPointState.None;
|
| | | findPreciousRedpoint.count = totalCount;
|
| | | }
|
| | |
|
| | | if (_redpointId == DemonJarModel.DEMONJAR_REDPOINTID ||
|
| | | _redpointId == DogzDungeonModel.DOGZDUNGEON_REDPOINT ||
|
| | | if (_redpointId == DogzDungeonModel.DOGZDUNGEON_REDPOINT ||
|
| | | _redpointId == JadeDynastyBossModel.JADEDYNASTY_REDPOINTID)
|
| | | {
|
| | | var demonJarRedpointCount = demonJarModel.redpoint.count;
|
| | | var dogzDungeonRedpointCount = dogzDungeonModel.redpoint.count;
|
| | | var jadeDynastyBossRedpointCount = jadeDynastyBossModel.redpoint.count;
|
| | | var totalCount = demonJarRedpointCount + dogzDungeonRedpointCount + jadeDynastyBossRedpointCount;
|
| | | var totalCount = dogzDungeonRedpointCount + jadeDynastyBossRedpointCount;
|
| | |
|
| | | lootPreciousRedpoint.count = totalCount;
|
| | | lootPreciousRedpoint.state = totalCount > 0 ? RedPointState.Quantity : RedPointState.None;
|
| | |
| | | { |
| | | |
| | | [SerializeField] FunctionButtonGroup m_FunctionGroup; |
| | | [SerializeField] FunctionButton m_DemonJar; |
| | | [SerializeField] FunctionButton m_FairyGrabBoss; |
| | | [SerializeField] FunctionButton m_DogzDungeon; |
| | | [SerializeField] FunctionButton m_JadeDynastyBoss; |
| | |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | m_DemonJar.AddListener(ShowDemonJar); |
| | | m_DogzDungeon.AddListener(ShowDogzDungeon); |
| | | m_RidingPetContention.AddListener(ShowRidingPetContention); |
| | | m_FairyGrabBoss.AddListener(FairyGrabBoss); |
| | |
| | | m_FunctionGroup.TriggerByOrder(functionOrder); |
| | | } |
| | | #endregion |
| | | |
| | | private void ShowDemonJar() |
| | | { |
| | | CloseSubWindows();
|
| | |
|
| | | m_NormalBottom.gameObject.SetActive(true); |
| | | |
| | | WindowCenter.Instance.Open<DemonJarWin>(); |
| | | functionOrder = m_DemonJar.order; |
| | | } |
| | | |
| | | private void FairyGrabBoss() |
| | | { |
| | |
| | | [SerializeField] BossIntroduceBehaviour m_BossIntroduce;
|
| | | [SerializeField] Text m_Times;
|
| | | [SerializeField] Button m_Goto;
|
| | | [SerializeField] RectTransform m_NoDamageTip;
|
| | |
|
| | | PersonalBossModel model { get { return ModelCenter.Instance.GetModel<PersonalBossModel>(); } }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | |
| | | {
|
| | | totalTimes = dungeonModel.GetTotalTimes(PersonalBossModel.PERSONALBOSS_MAPID);
|
| | | enterTimes = dungeonModel.GetEnterTimes(PersonalBossModel.PERSONALBOSS_MAPID);
|
| | | m_Times.text = Language.Get("WorldBoss_Endurance0", totalTimes - enterTimes);
|
| | | m_Times.text = Language.Get("WorldBoss_Endurance0", totalTimes - enterTimes);
|
| | | m_Times.color = UIHelper.GetUIColor((totalTimes - enterTimes) > 0 ? TextColType.Green : TextColType.Red, true);
|
| | | }
|
| | |
|
| | |
| | | m_BossIntroduce.Display(model.selectedBoss, true);
|
| | | m_Bosses.Init(bosses);
|
| | | m_Bosses.MoveToCenter(bosses.IndexOf(model.selectedBoss));
|
| | |
|
| | | DisplayTip(model.selectedBoss);
|
| | | }
|
| | |
|
| | | private void GotoKillBoss()
|
| | |
| | | return true;
|
| | | }
|
| | |
|
| | | private void OnBossSelected(int _bossId)
|
| | | private void OnBossSelected(int bossId)
|
| | | {
|
| | | m_BossIntroduce.Display(_bossId, false);
|
| | | m_BossIntroduce.Display(bossId, false);
|
| | | DisplayTip(bossId);
|
| | | }
|
| | |
|
| | | private void DisplayTip(int bossId)
|
| | | {
|
| | | var realmLevel = PlayerDatas.Instance.baseData.realmLevel;
|
| | | var config = NPCConfig.Get(bossId);
|
| | |
|
| | | if (config.Realm > realmLevel)
|
| | | {
|
| | | m_NoDamageTip.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_NoDamageTip.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | public class WorldBossBreifInfoBehaviour : FindPreciousBossBriefInfoBehaviour
|
| | | {
|
| | | [SerializeField] Image m_Attention;
|
| | | [SerializeField] RectTransform m_UnLockCondition;
|
| | | [SerializeField] Image m_UnLockRealm;
|
| | |
|
| | | protected override int selectedBossId {
|
| | | get {
|
| | |
| | | m_Attention.gameObject.SetActive(findPreciousModel.IsBossSubscribed(bossId));
|
| | | }
|
| | |
|
| | | protected override void DrawBossBaseInfo(string icon, string name, int level, int realm)
|
| | | {
|
| | | m_Portrait.SetSprite(icon);
|
| | | m_Portrait.SetNativeSize();
|
| | | m_BossName.text = name;
|
| | | m_BossLevel.text = Language.Get("Z1024", level);
|
| | |
|
| | | m_RealmContainer.gameObject.SetActive(isUnLocked);
|
| | | m_UnLockCondition.gameObject.SetActive(!isUnLocked);
|
| | | if (!isUnLocked)
|
| | | {
|
| | | var unLockRealm = model.GetBossUnLockRealm(bossId);
|
| | | var config = RealmConfig.Get(unLockRealm);
|
| | | m_UnLockRealm.SetSprite(config.Img);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (m_Realm != null && m_RealmContainer != null)
|
| | | {
|
| | | if (RealmConfig.Has(realm))
|
| | | {
|
| | | m_RealmContainer.gameObject.SetActive(true);
|
| | | var realmConfig = RealmConfig.Get(realm);
|
| | | if (realmConfig != null)
|
| | | {
|
| | | m_Realm.SetSprite(realmConfig.Img);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | m_RealmContainer.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | using UnityEngine;
|
| | | using System;
|
| | |
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | [XLua.LuaCallCSharp]
|
| | | public class WorldBossModel : Model
|
| | | public class WorldBossModel : Model
|
| | | {
|
| | |
|
| | | public const int WORLDBOSS_REDPOINT = 76001;
|
| | |
|
| | | int m_SelectedBoss = 0;
|
| | |
| | |
|
| | | public Redpoint worldBossRedPoint = new Redpoint(FindPreciousModel.FINDPRECIOUS_REDPOINTID, WORLDBOSS_REDPOINT);
|
| | | FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } }
|
| | | RealmModel realmModel { get { return ModelCenter.Instance.GetModel<RealmModel>(); } }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | |
| | | public List<int> GetWorldBosses()
|
| | | {
|
| | | var activedBossIds = new List<int>();
|
| | | var mapModel = ModelCenter.Instance.GetModel<MapModel>();
|
| | | for (int i = 0; i < sortedBossIds.Count; i++)
|
| | | {
|
| | | var bossId = sortedBossIds[i];
|
| | | var config = WorldBossConfig.Get(bossId);
|
| | | var mapId = config.MapID;
|
| | | if (mapModel.IsMapUnlocked(mapId))
|
| | | if (IsBossUnLockedOrUnlockSoon(bossId))
|
| | | {
|
| | | activedBossIds.Add(bossId);
|
| | | }
|
| | |
| | | public List<int> GetWorldBosses(int _mapId)
|
| | | {
|
| | | var bosses = new List<int>();
|
| | | var mapModel = ModelCenter.Instance.GetModel<MapModel>();
|
| | | for (int i = 0; i < sortedBossIds.Count; i++)
|
| | | {
|
| | | var bossId = sortedBossIds[i];
|
| | |
| | | return worldBosses.ContainsKey(_bossId) && worldBosses[_bossId].isUnLocked;
|
| | | }
|
| | |
|
| | | public int GetLatestUnLockBoss()
|
| | | public int GetRecommendBoss()
|
| | | {
|
| | | var playerLevel = PlayerDatas.Instance.baseData.LV;
|
| | | for (int i = sortedBossIds.Count - 1; i >= 0; i--)
|
| | |
| | | return sortedBossIds[0];
|
| | | }
|
| | |
|
| | | public int GetBossUnLockRealm(int bossId)
|
| | | {
|
| | | if (!worldBosses.ContainsKey(bossId))
|
| | | {
|
| | | return 0;
|
| | | }
|
| | |
|
| | | var config = NPCConfig.Get(bossId);
|
| | | var realmStage = realmModel.GetRealmStage(config.Realm);
|
| | | var realms = new List<int>();
|
| | | if (realmModel.TryGetRealmStages(realmStage, out realms))
|
| | | {
|
| | | return realms[0];
|
| | | }
|
| | | else
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | }
|
| | |
|
| | | private bool IsBossUnLockedOrUnlockSoon(int bossId)
|
| | | {
|
| | | var myRealmLevel = PlayerDatas.Instance.baseData.realmLevel;
|
| | | var myRealmStage = realmModel.GetRealmStage(myRealmLevel);
|
| | |
|
| | | var config = NPCConfig.Get(bossId);
|
| | | var bossRealmStage = realmModel.GetRealmStage(config.Realm);
|
| | |
|
| | | if (myRealmStage >= bossRealmStage)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
|
| | | if (myRealmStage + 1 >= bossRealmStage)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
|
| | | return false;
|
| | | }
|
| | |
|
| | | private void ParseConfig()
|
| | | {
|
| | | var worldBossConfigs = WorldBossConfig.GetValues();
|
| | |
| | | sortedBossIds.AddRange(worldBosses.Keys);
|
| | | sortedBossIds.Sort(WorldBossData.LevelCompare);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public class WorldBossData
|
| | | {
|
| | | MapModel mapModel { get { return ModelCenter.Instance.GetModel<MapModel>(); } }
|
| | | RealmModel realmModel { get { return ModelCenter.Instance.GetModel<RealmModel>(); } }
|
| | |
|
| | | public int id { get; private set; }
|
| | | public bool isUnLocked {
|
| | | get {
|
| | | var config = WorldBossConfig.Get(id);
|
| | | var mapUnLocked = mapModel.IsMapUnlocked(config.MapID);
|
| | | return mapUnLocked;
|
| | | var myRealmLevel = PlayerDatas.Instance.baseData.realmLevel;
|
| | | var myRealmStage = realmModel.GetRealmStage(myRealmLevel);
|
| | |
|
| | | var config = NPCConfig.Get(id);
|
| | | var bossRealmStage = realmModel.GetRealmStage(config.Realm);
|
| | |
|
| | | return myRealmStage >= bossRealmStage;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | [SerializeField] Button m_Goto;
|
| | | [SerializeField] Button m_KillRecord;
|
| | | [SerializeField] Transform m_SurpassLevel;
|
| | | [SerializeField] RectTransform m_NoDamageTip;
|
| | | [SerializeField] ToggleButton m_Subscribe;
|
| | |
|
| | | WorldBossModel model { get { return ModelCenter.Instance.GetModel<WorldBossModel>(); } }
|
| | | MapModel mapModel { get { return ModelCenter.Instance.GetModel<MapModel>(); } }
|
| | | FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | BossHomeModel bossHomeModel { get { return ModelCenter.Instance.GetModel<BossHomeModel>(); } }
|
| | |
| | | var bosses = new List<int>();
|
| | | bosses.AddRange(model.GetWorldBosses());
|
| | |
|
| | | model.selectedBoss = model.GetLatestUnLockBoss();
|
| | | m_Subscribe.isOn = findPreciousModel.IsBossSubscribed(model.selectedBoss);
|
| | | model.selectedBoss = model.GetRecommendBoss();
|
| | |
|
| | | m_BossIntroduce.Display(model.selectedBoss, true);
|
| | | m_Bosses.Init(bosses);
|
| | | m_Bosses.MoveToCenter(bosses.IndexOf(model.selectedBoss));
|
| | |
|
| | | var config = NPCConfig.Get(model.selectedBoss);
|
| | | var npcDropConfig = NPCDropItemConfig.Get(model.selectedBoss);
|
| | | m_SurpassLevel.gameObject.SetActive(npcDropConfig.MaxLV != 0 && PlayerDatas.Instance.baseData.LV > npcDropConfig.MaxLV);
|
| | | DisplayGotoKillButton(model.selectedBoss);
|
| | | DisplaySubscribe(model.selectedBoss);
|
| | | DisplayTip(model.selectedBoss);
|
| | | }
|
| | |
|
| | | private void ShowKillRecords()
|
| | |
| | | m_Subscribe.isOn = findPreciousModel.IsBossSubscribed(model.selectedBoss);
|
| | | }
|
| | |
|
| | | private void OnBossSelected(int _bossId)
|
| | | private void OnBossSelected(int bossId)
|
| | | {
|
| | | m_BossIntroduce.Display(_bossId, false);
|
| | | m_Subscribe.isOn = findPreciousModel.IsBossSubscribed(_bossId);
|
| | | var npcDropConfig = NPCDropItemConfig.Get(model.selectedBoss);
|
| | | m_SurpassLevel.gameObject.SetActive(npcDropConfig.MaxLV != 0 && PlayerDatas.Instance.baseData.LV > npcDropConfig.MaxLV);
|
| | | m_BossIntroduce.Display(bossId, false);
|
| | | DisplayGotoKillButton(bossId);
|
| | | DisplaySubscribe(bossId);
|
| | | DisplayTip(bossId);
|
| | | }
|
| | |
|
| | | private void OnBossWearyValue()
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void DisplayGotoKillButton(int bossId)
|
| | | {
|
| | | var isUnLocked = model.IsBossUnLocked(bossId);
|
| | | m_Goto.gameObject.SetActive(isUnLocked);
|
| | | }
|
| | |
|
| | | private void DisplaySubscribe(int bossId)
|
| | | {
|
| | | var isUnLocked = model.IsBossUnLocked(bossId);
|
| | | m_Subscribe.gameObject.SetActive(isUnLocked);
|
| | | if (isUnLocked)
|
| | | {
|
| | | m_Subscribe.isOn = findPreciousModel.IsBossSubscribed(bossId);
|
| | | }
|
| | | }
|
| | |
|
| | | private void DisplayTip(int bossId)
|
| | | {
|
| | | var realmLevel = PlayerDatas.Instance.baseData.realmLevel;
|
| | | var config = NPCConfig.Get(bossId);
|
| | |
|
| | | if (config.Realm > realmLevel)
|
| | | {
|
| | | m_NoDamageTip.gameObject.SetActive(true);
|
| | | m_SurpassLevel.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_NoDamageTip.gameObject.SetActive(false);
|
| | | var dropConfig = NPCDropItemConfig.Get(bossId);
|
| | | var noDrop = dropConfig == null || (dropConfig.MaxLV != 0 && PlayerDatas.Instance.baseData.LV > dropConfig.MaxLV);
|
| | | m_SurpassLevel.gameObject.SetActive(noDrop);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | } |
| | | } |
| | | |
| | | if (trialModel.trialTokens.Contains(item.itemId)) |
| | | { |
| | | if (!trialModel.IsAnySatisfyExchangeBetter(item.itemId)) |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | //if (trialModel.trialTokens.Contains(item.itemId)) |
| | | //{ |
| | | // if (!trialModel.IsAnySatisfyExchangeBetter(item.itemId)) |
| | | // { |
| | | // return false; |
| | | // } |
| | | //} |
| | | |
| | | if (packModel.CheckIsDrugById(item.itemId)) |
| | | { |
| | |
| | | [SerializeField] ScrollerController ctrl;
|
| | | [SerializeField] CanvasGroup canvas;
|
| | | [SerializeField] SortMakeDrugTable drugTable;
|
| | | [SerializeField] SortMakeDrugTable drugTypeTable;
|
| | | [SerializeField] Transform tableArrow;
|
| | | [SerializeField] Button selectBtn;
|
| | | [SerializeField] Transform typeTableArrow;
|
| | | [SerializeField] Button selectQualityBtn;
|
| | | [SerializeField] Button selectTypeBtn;
|
| | | PackModel _playerPack;
|
| | | PackModel playerPack
|
| | | {
|
| | |
| | | int presentIndex = 0;
|
| | | private void Awake()
|
| | | {
|
| | | selectBtn.AddListener(ClickDrugSelect);
|
| | | selectQualityBtn.AddListener(ClickQualitySelect);
|
| | | selectTypeBtn.AddListener(ClickTypeSelect);
|
| | | }
|
| | |
|
| | | private void OnEnable()
|
| | |
| | | blastModel.sortDruglist.Clear();
|
| | | ctrl.OnRefreshCell += RefreshMakeDrugCell;
|
| | | drugTable.onSortCloseEvent += CloseDrugSort;
|
| | | drugTypeTable.onSortCloseEvent += CloseDrugTypeSort;
|
| | | drugTable.onSelectSortEvent += CreateCell;
|
| | | ctrl.lockType = EnhanceLockType.KeepVertical;
|
| | | canvas.alpha = 0;
|
| | | presentIndex = 0;
|
| | | drugTable.gameObject.SetActive(false);
|
| | | drugTable.SetDefault();
|
| | | drugTypeTable.gameObject.SetActive(false);
|
| | | drugTypeTable.SetDefault();
|
| | | CreateCell();
|
| | | CheckJumpToModel();
|
| | | ModelCenter.Instance.GetModel<BlastFurnaceModel>().IsMakeDrugWin = true;
|
| | | CloseDrugSort();
|
| | | CloseDrugTypeSort();
|
| | | }
|
| | |
|
| | | private void OnDisable()
|
| | | {
|
| | | drugTable.onSortCloseEvent -= CloseDrugSort;
|
| | | drugTypeTable.onSortCloseEvent -= CloseDrugTypeSort;
|
| | | ctrl.OnRefreshCell -= RefreshMakeDrugCell;
|
| | | drugTable.onSelectSortEvent -= CreateCell;
|
| | | ModelCenter.Instance.GetModel<BlastFurnaceModel>().IsMakeDrugWin = false;
|
| | | }
|
| | |
|
| | | private void ClickDrugSelect()
|
| | | private void ClickQualitySelect()
|
| | | {
|
| | | tableArrow.localRotation = Quaternion.Euler(0, 0, 0);
|
| | | if (!drugTable.gameObject.activeInHierarchy)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void ClickTypeSelect()
|
| | | {
|
| | | typeTableArrow.localRotation = Quaternion.Euler(0, 0, 0);
|
| | | if (!drugTypeTable.gameObject.activeInHierarchy)
|
| | | {
|
| | | drugTypeTable.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | |
|
| | | private void CloseDrugSort()
|
| | | {
|
| | | tableArrow.localRotation = Quaternion.Euler(0, 0, 180);
|
| | | }
|
| | |
|
| | | private void CloseDrugTypeSort()
|
| | | {
|
| | | typeTableArrow.localRotation = Quaternion.Euler(0, 0, 180);
|
| | | }
|
| | |
|
| | | private void CheckJumpToModel()
|
| | | {
|
| | | if(AchievementGoto.guideAchievementId != 0)
|
| | |
| | |
|
| | | [SerializeField] Image m_Description;
|
| | | [SerializeField] Image m_JobName;
|
| | | [SerializeField] Image m_JobSign;
|
| | |
|
| | | [SerializeField] PositionTween m_LeftPostionTween;
|
| | | [SerializeField] PositionTween m_RightPositionTween;
|
| | |
| | | var config = CreateRoleConfig.Get(job);
|
| | | m_Description.SetSprite(config.description);
|
| | | m_JobName.SetSprite(config.jobName);
|
| | | m_JobSign.SetSprite(config.jobSign);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | MaxProDef = (int)matchOK.MatchPlayer[0].MaxProDef,
|
| | | };
|
| | |
|
| | | Clock.Create(DateTime.Now + new TimeSpan(3 * TimeSpan.TicksPerSecond), () =>
|
| | | Clock.AlarmAt(DateTime.Now + new TimeSpan(3 * TimeSpan.TicksPerSecond), () =>
|
| | | {
|
| | | if (oneVsOnePlayerData.waitForLoginCrossServer)
|
| | | {
|
| | |
| | | gamePortBuf = gamePort;
|
| | |
|
| | | StopLoginOverTimeProcess();
|
| | | loginOverTimeClock = Clock.Create(DateTime.Now + new TimeSpan(30 * TimeSpan.TicksPerSecond), () =>
|
| | | loginOverTimeClock = Clock.AlarmAt(DateTime.Now + new TimeSpan(30 * TimeSpan.TicksPerSecond), () =>
|
| | | {
|
| | | busy = false;
|
| | | ReAccountLogin();
|
| | |
| | | {
|
| | | this.reconnectBackGround = true;
|
| | | StopLoginOverTimeProcess();
|
| | | loginOverTimeClock = Clock.Create(DateTime.Now + new TimeSpan(30 * TimeSpan.TicksPerSecond), () =>
|
| | | loginOverTimeClock = Clock.AlarmAt(DateTime.Now + new TimeSpan(30 * TimeSpan.TicksPerSecond), () =>
|
| | | {
|
| | | busy = false;
|
| | | ReAccountLogin();
|
| | |
| | | {
|
| | | if (loginOverTimeClock != null)
|
| | | {
|
| | | loginOverTimeClock.Stop();
|
| | | Clock.Stop(loginOverTimeClock);
|
| | | }
|
| | | |
| | | loginOverTimeClock = null;
|
| | | }
|
| | |
|
| | |
| | | var sendInfo = new CC003_tagCGForceQuitCrossState();
|
| | | GameNetSystem.Instance.SendInfo(sendInfo);
|
| | | GameNetSystem.Instance.crossServerConnected_Loigc = false;
|
| | | Clock.Create(DateTime.Now + new TimeSpan(2 * TimeSpan.TicksPerSecond), () =>
|
| | | Clock.AlarmAt(DateTime.Now + new TimeSpan(2 * TimeSpan.TicksPerSecond), () =>
|
| | | {
|
| | | GameNetSystem.Instance.Reconnect();
|
| | | });
|
| | |
| | |
|
| | | [SerializeField] Image m_Description;
|
| | | [SerializeField] Image m_JobName;
|
| | | [SerializeField] Image m_JobSign;
|
| | |
|
| | | SelectRoleProcessor m_SelectRoleProcessor;
|
| | | SelectRoleProcessor selectRoleProcessor {
|
| | |
| | | var config = CreateRoleConfig.Get(PlayerDatas.Instance.loginInfo.Job);
|
| | | m_Description.SetSprite(config.description);
|
| | | m_JobName.SetSprite(config.jobName);
|
| | | m_JobSign.SetSprite(config.jobSign);
|
| | |
|
| | | selectRoleProcessor.Show(PlayerDatas.Instance.loginInfo.Job);
|
| | | }
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | Clock.Create(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), RequestJumpUrl);
|
| | | Clock.AlarmAt(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), RequestJumpUrl);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | Clock.Create(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), RequestServerCommonList);
|
| | | Clock.AlarmAt(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), RequestServerCommonList);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | if (StageLoad.Instance.currentStage == null || StageLoad.Instance.currentStage is LoginStage)
|
| | | {
|
| | | Clock.Create(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), () =>
|
| | | Clock.AlarmAt(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), () =>
|
| | | {
|
| | | RequestServerListPlayer(accountNameBuf);
|
| | | });
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<LootPreciousFrameWin>();
|
| | | WindowCenter.Instance.Open<LootPreciousFrameWin>(false, 1);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | |
| | | using System.Collections.Generic; |
| | | using System; |
| | | |
| | | //是否显示XP |
| | | namespace Snxxz.UI |
| | | { |
| | |
| | | Skill.OnSkillCDFinished -= OnSkillCDFinished; |
| | | Skill.OnSkillCast -= OnSkillCast; |
| | | PlayerMainDate.Event_XpSkill -= OPenXpSkill; |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | private void OPenXpSkill()//获得技能 |
| | | { |
| | |
| | | m_UiEffect.Play(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | private void StorageList() |
| | | { |
| | |
| | | { |
| | | ProhibitedToRelease.Add(int.Parse(list[i])); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | //技能详情面板 |
| | | namespace Snxxz.UI { |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class LongPressShowPanel:MonoBehaviour { |
| | | public class LongPressShowPanel : MonoBehaviour |
| | | { |
| | | public Image m_Icon; |
| | | public Text Name; |
| | | public Text Describe; |
| | | |
| | | public void Display(int skillId) |
| | | { |
| | | var treasureModel = ModelCenter.Instance.GetModel<TreasureModel>(); |
| | | var treasures = treasureModel.GetAllTreasure(); |
| | | var treasureId = 0; |
| | | |
| | | for (int i = 0; i < treasures.Count; i++) |
| | | { |
| | | Treasure treasure; |
| | | if (treasureModel.TryGetTreasure(treasures[i], out treasure)) |
| | | { |
| | | if (treasure.skillId == skillId) |
| | | { |
| | | treasureId = treasure.id; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | var skillConfig = SkillConfig.Get(skillId); |
| | | Name.text = skillConfig.SkillName; |
| | | Describe.text = skillConfig.Description; |
| | | |
| | | var treasureConfig = TreasureConfig.Get(treasureId); |
| | | m_Icon.SetSprite(treasureConfig.Icon); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | [SerializeField] TopRightTip m_TopRightTip;
|
| | | [SerializeField] FunctionForecastTip m_FunctionForecastTip;//功能预告
|
| | | [SerializeField] IsShowXpButton m_IsShowXp;//XP 技能常显
|
| | | [SerializeField] SkillButtonEffects m_SkillButtonEffects;
|
| | | [SerializeField] FairyLeagueRemindBehaviour m_FairyLeagueRemind;
|
| | | [SerializeField] TeamInvitationEntrance m_TeamInvitationEntrance;
|
| | | [SerializeField] FairyCallMemberBehaviour m_FairyCallBehaviour;
|
| | |
| | | m_TaskListTip.Init();
|
| | | m_IsShowXp.Init();
|
| | | m_TopRightTip.Init();
|
| | | m_SkillButtonEffects.Init();
|
| | | m_AnimationFadeOut.Init();
|
| | | m_TeamInvitationEntrance.Init();
|
| | | m_FairyCallBehaviour.Init();
|
| | |
| | | m_HighSettingFadeInFadeOut.UnInit();
|
| | | m_TaskListTip.UnInit();
|
| | | m_TopRightTip.UnInit();
|
| | | m_SkillButtonEffects.UnInit();
|
| | | m_FunctionForecastTip.Unit();
|
| | | m_AnimationFadeOut.Unit();
|
| | | m_TeamInvitationEntrance.UnInit();
|
| | |
| | | |
| | | public class SkillButtonEffects : MonoBehaviour |
| | | { |
| | | [SerializeField] AttackButton m_Attack; |
| | | |
| | | [SerializeField] SkillButton m_BlinkSkill; |
| | | [SerializeField] SkillButton m_Skill1; |
| | | [SerializeField] SkillButton m_Skill2; |
| | | [SerializeField] SkillButton m_Skill3; |
| | | [SerializeField] SkillButton m_Skill4; |
| | | [SerializeField] SkillButton m_Skill5; |
| | | [SerializeField] SkillButton m_Skill6; |
| | | [SerializeField] SkillButton m_Skill7; |
| | | [SerializeField] SkillButton m_SkillXp; |
| | | |
| | | [SerializeField] Transform Skill1Info; |
| | | [SerializeField] Transform Skill2Info; |
| | | [SerializeField] Transform Skill3Info; |
| | | [SerializeField] Transform Skill4Info; |
| | | [SerializeField] Transform Skill5Info; |
| | | [SerializeField] Transform Skill6Info; |
| | | [SerializeField] Transform Skill7Info; |
| | | [SerializeField] Transform XpSkillInfo; |
| | | |
| | | [SerializeField] GameObject SkillSelected1; |
| | | [SerializeField] GameObject SkillSelected2; |
| | | [SerializeField] GameObject SkillSelected3; |
| | | [SerializeField] GameObject SkillSelected4; |
| | | [SerializeField] GameObject SkillSelected5; |
| | | [SerializeField] GameObject SkillSelected6; |
| | | [SerializeField] GameObject SkillSelected7; |
| | | [SerializeField] GameObject SkillSelectedXp; |
| | | |
| | | LongPressShowPanel _LongPressShowPanel; |
| | | public float TimeLong = 1f; |
| | | private bool BoolFb = false; |
| | | private bool AccordingBool = true;//显示开关 |
| | | private int SkillsHole = -1;//获取技能孔 |
| | | private float _currentime = 0; |
| | | private int m_PlayerXpSkillId = 0; |
| | | private bool _bool = false; |
| | | UIEffect effect; |
| | | |
| | | private float preTime = 0; |
| | | |
| | | private void Awake() |
| | | { |
| | | m_PlayerXpSkillId = ConfigParse.GetDic<int, int>(FuncConfigConfig.Get("XpSkillID").Numerical1)[PlayerDatas.Instance.baseData.Job];//获取各个职业的XP技能 |
| | | MagicWeapon(); |
| | | } |
| | | |
| | | public void Init() |
| | | { |
| | | SkillSelected1.SetActive(false); |
| | | SkillSelected2.SetActive(false); |
| | | SkillSelected3.SetActive(false); |
| | | SkillSelected4.SetActive(false); |
| | | SkillSelected5.SetActive(false); |
| | | SkillSelected6.SetActive(false); |
| | | SkillSelected7.SetActive(false); |
| | | SkillSelectedXp.SetActive(false); |
| | | TipShutDown(-1); |
| | | |
| | | Skill.OnSkillCDFinished += OnSkillCDFinished; |
| | | Skill.OnSkillCast += OnSkillCast; |
| | | } |
| | | |
| | | public void UnInit() |
| | | { |
| | | TipShutDown(-1); |
| | | Skill.OnSkillCDFinished -= OnSkillCDFinished; |
| | | Skill.OnSkillCast -= OnSkillCast; |
| | | } |
| | | |
| | | private void OnSkillCast(uint objSID, int obj) |
| | | { |
| | | if (objSID != PlayerDatas.Instance.PlayerId) |
| | | { |
| | | return; |
| | | } |
| | | if (obj != 0 && obj == m_PlayerXpSkillId) |
| | | { |
| | | EffectMgr.Instance.PlayUIEffect(1023, 1500, m_SkillXp.transform, false); |
| | | } |
| | | int position = PlayerDatas.Instance.skill.ContainsQuickSkill(obj); |
| | | switch ((SkillEffects)position) |
| | | { |
| | | case SkillEffects.skillEffect_1: |
| | | EffectMgr.Instance.PlayUIEffect(1023, 1500, m_Skill1.transform, false); |
| | | break; |
| | | case SkillEffects.skillEffect_2: |
| | | EffectMgr.Instance.PlayUIEffect(1023, 1500, m_Skill2.transform, false); |
| | | break; |
| | | case SkillEffects.skillEffect_3: |
| | | EffectMgr.Instance.PlayUIEffect(1023, 1500, m_Skill3.transform, false); |
| | | break; |
| | | case SkillEffects.skillEffect_4: |
| | | EffectMgr.Instance.PlayUIEffect(1023, 1500, m_Skill4.transform, false); |
| | | break; |
| | | case SkillEffects.skillEffect_5: |
| | | EffectMgr.Instance.PlayUIEffect(1023, 1500, m_Skill5.transform, false); |
| | | break; |
| | | case SkillEffects.skillEffect_6: |
| | | EffectMgr.Instance.PlayUIEffect(1023, 1500, m_Skill6.transform, false); |
| | | break; |
| | | case SkillEffects.skillEffect_7: |
| | | EffectMgr.Instance.PlayUIEffect(1023, 1500, m_Skill7.transform, false); |
| | | break; |
| | | case SkillEffects.skillEffect_xp: |
| | | //EffectMgr.Instance.PlayUIEffect(1023, 1500, m_SkillXp.transform, false); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | } |
| | | |
| | | private void OnSkillCDFinished(int obj) |
| | | { |
| | | if (obj != 0 && obj == m_PlayerXpSkillId) |
| | | { |
| | | EffectMgr.Instance.PlayUIEffect(1024, 1500, m_SkillXp.transform, false); |
| | | } |
| | | int position = PlayerDatas.Instance.skill.ContainsQuickSkill(obj); |
| | | switch ((SkillEffects)position) |
| | | { |
| | | case SkillEffects.skillEffect_1: |
| | | EffectMgr.Instance.PlayUIEffect(1024, 1500, m_Skill1.transform, false); |
| | | break; |
| | | case SkillEffects.skillEffect_2: |
| | | EffectMgr.Instance.PlayUIEffect(1024, 1500, m_Skill2.transform, false); |
| | | break; |
| | | case SkillEffects.skillEffect_3: |
| | | EffectMgr.Instance.PlayUIEffect(1024, 1500, m_Skill3.transform, false); |
| | | break; |
| | | case SkillEffects.skillEffect_4: |
| | | EffectMgr.Instance.PlayUIEffect(1024, 1500, m_Skill4.transform, false); |
| | | break; |
| | | case SkillEffects.skillEffect_5: |
| | | EffectMgr.Instance.PlayUIEffect(1024, 1500, m_Skill5.transform, false); |
| | | break; |
| | | case SkillEffects.skillEffect_6: |
| | | EffectMgr.Instance.PlayUIEffect(1024, 1500, m_Skill6.transform, false); |
| | | break; |
| | | case SkillEffects.skillEffect_7: |
| | | EffectMgr.Instance.PlayUIEffect(1024, 1500, m_Skill7.transform, false); |
| | | break; |
| | | case SkillEffects.skillEffect_xp: |
| | | //EffectMgr.Instance.PlayUIEffect(1024, 1500, m_SkillXp.transform, false); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | private void Start() |
| | | { |
| | | UIEventTrigger.Get(m_Attack.gameObject).OnDown = DownAttackButton; |
| | | UIEventTrigger.Get(m_Skill1.gameObject).OnDown = DownAttackButton; |
| | | UIEventTrigger.Get(m_Skill2.gameObject).OnDown = DownAttackButton; |
| | | UIEventTrigger.Get(m_Skill3.gameObject).OnDown = DownAttackButton; |
| | | UIEventTrigger.Get(m_Skill4.gameObject).OnDown = DownAttackButton; |
| | | UIEventTrigger.Get(m_Skill5.gameObject).OnDown = DownAttackButton; |
| | | UIEventTrigger.Get(m_Skill6.gameObject).OnDown = DownAttackButton; |
| | | UIEventTrigger.Get(m_Skill7.gameObject).OnDown = DownAttackButton; |
| | | UIEventTrigger.Get(m_SkillXp.gameObject).OnDown = DownAttackButton; |
| | | |
| | | UIEventTrigger.Get(m_Attack.gameObject).OnUp = UpAttackButton; |
| | | UIEventTrigger.Get(m_Skill1.gameObject).OnUp = UpAttackButton; |
| | | UIEventTrigger.Get(m_Skill2.gameObject).OnUp = UpAttackButton; |
| | | UIEventTrigger.Get(m_Skill3.gameObject).OnUp = UpAttackButton; |
| | | UIEventTrigger.Get(m_Skill4.gameObject).OnUp = UpAttackButton; |
| | | UIEventTrigger.Get(m_Skill5.gameObject).OnUp = UpAttackButton; |
| | | UIEventTrigger.Get(m_Skill6.gameObject).OnUp = UpAttackButton; |
| | | UIEventTrigger.Get(m_Skill7.gameObject).OnUp = UpAttackButton; |
| | | UIEventTrigger.Get(m_SkillXp.gameObject).OnUp = UpAttackButton; |
| | | } |
| | | |
| | | private void OnComplete() |
| | | { |
| | | if (_bool) |
| | | { |
| | | effect = EffectMgr.Instance.PlayUIEffect(1021, 1500, m_Attack.transform, false); |
| | | effect.OnComplete = OnComplete; |
| | | } |
| | | } |
| | | |
| | | void DownAttackButton(GameObject go) |
| | | { |
| | | switch (go.name) |
| | | { |
| | | case "AttackBtn": |
| | | preTime = Time.time; |
| | | effect = EffectMgr.Instance.PlayUIEffect(1021, 1500, m_Attack.transform, false); |
| | | effect.OnComplete = OnComplete; |
| | | _bool = true; |
| | | break; |
| | | case "Btn_Skill1": |
| | | Prompting((int)SkillEffects.skillEffect_1); |
| | | if (PlayerDatas.Instance.skill.GetQuickSkillByPos((int)SkillEffects.skillEffect_1) == null) |
| | | { |
| | | return; |
| | | } |
| | | BoolFb = true; |
| | | AccordingBool = true; |
| | | SkillsHole = (int)SkillEffects.skillEffect_1; |
| | | SkillSelected1.SetActive(true); |
| | | break; |
| | | case "Btn_Skill2": |
| | | Prompting((int)SkillEffects.skillEffect_2); |
| | | if (PlayerDatas.Instance.skill.GetQuickSkillByPos((int)SkillEffects.skillEffect_2) == null) |
| | | return; |
| | | BoolFb = true; |
| | | AccordingBool = true; |
| | | SkillsHole = (int)SkillEffects.skillEffect_2; |
| | | SkillSelected2.SetActive(true); |
| | | break; |
| | | case "Btn_Skill3": |
| | | Prompting((int)SkillEffects.skillEffect_3); |
| | | if (PlayerDatas.Instance.skill.GetQuickSkillByPos((int)SkillEffects.skillEffect_3) == null) |
| | | return; |
| | | BoolFb = true; |
| | | AccordingBool = true; |
| | | SkillsHole = (int)SkillEffects.skillEffect_3; |
| | | SkillSelected3.SetActive(true); |
| | | break; |
| | | case "Btn_Skill4": |
| | | Prompting((int)SkillEffects.skillEffect_4); |
| | | if (PlayerDatas.Instance.skill.GetQuickSkillByPos((int)SkillEffects.skillEffect_4) == null) |
| | | return; |
| | | BoolFb = true; |
| | | AccordingBool = true; |
| | | SkillsHole = (int)SkillEffects.skillEffect_4; |
| | | SkillSelected4.SetActive(true); |
| | | break; |
| | | case "Btn_Skill5": |
| | | Prompting((int)SkillEffects.skillEffect_5); |
| | | if (PlayerDatas.Instance.skill.GetQuickSkillByPos((int)SkillEffects.skillEffect_5) == null) |
| | | return; |
| | | BoolFb = true; |
| | | AccordingBool = true; |
| | | SkillsHole = (int)SkillEffects.skillEffect_5; |
| | | SkillSelected5.SetActive(true); |
| | | break; |
| | | case "Btn_Skill6": |
| | | Prompting((int)SkillEffects.skillEffect_6); |
| | | if (PlayerDatas.Instance.skill.GetQuickSkillByPos((int)SkillEffects.skillEffect_6) == null) |
| | | return; |
| | | BoolFb = true; |
| | | AccordingBool = true; |
| | | SkillsHole = (int)SkillEffects.skillEffect_6; |
| | | SkillSelected6.SetActive(true); |
| | | break; |
| | | case "Btn_Skill7": |
| | | Prompting((int)SkillEffects.skillEffect_7); |
| | | if (PlayerDatas.Instance.skill.GetQuickSkillByPos((int)SkillEffects.skillEffect_7) == null) |
| | | return; |
| | | BoolFb = true; |
| | | AccordingBool = true; |
| | | SkillsHole = (int)SkillEffects.skillEffect_7; |
| | | SkillSelected7.SetActive(true); |
| | | break; |
| | | case "Btn_SkillXp": |
| | | Prompting((int)SkillEffects.skillEffect_xp); |
| | | var skillModel = ModelCenter.Instance.GetModel<SkillModel>();
|
| | | var xpSkillId = skillModel.GetXpSkillID(); |
| | | if (PlayerDatas.Instance.skill.GetSKillById(xpSkillId) != null)
|
| | | {
|
| | | BoolFb = true;
|
| | | AccordingBool = true;
|
| | | SkillsHole = (int)SkillEffects.skillEffect_xp;
|
| | | SkillSelectedXp.SetActive(true);
|
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | void UpAttackButton(GameObject go) |
| | | { |
| | | _currentime = 0; |
| | | TipShutDown(-1); |
| | | switch (go.name) |
| | | { |
| | | case "AttackBtn": |
| | | _bool = false; |
| | | if (effect != null) |
| | | { |
| | | if (Time.time - preTime < effect.duration) |
| | | { |
| | | effect.OnComplete = null; |
| | | } |
| | | } |
| | | break; |
| | | case "Btn_Skill1": |
| | | BoolFb = false; |
| | | SkillSelected1.SetActive(false); |
| | | break; |
| | | case "Btn_Skill2": |
| | | BoolFb = false; |
| | | SkillSelected2.SetActive(false); |
| | | break; |
| | | case "Btn_Skill3": |
| | | BoolFb = false; |
| | | SkillSelected3.SetActive(false); |
| | | break; |
| | | case "Btn_Skill4": |
| | | BoolFb = false; |
| | | SkillSelected4.SetActive(false); |
| | | break; |
| | | case "Btn_Skill5": |
| | | BoolFb = false; |
| | | SkillSelected5.SetActive(false); |
| | | break; |
| | | case "Btn_Skill6": |
| | | BoolFb = false; |
| | | SkillSelected6.SetActive(false); |
| | | break; |
| | | case "Btn_Skill7": |
| | | BoolFb = false; |
| | | SkillSelected7.SetActive(false); |
| | | break; |
| | | case "Btn_SkillXp": |
| | | BoolFb = false; |
| | | SkillSelectedXp.SetActive(false); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | private Dictionary<int, int> _SkillAndPreTreasure = new Dictionary<int, int>(); |
| | | void MagicWeapon()//法宝获取 |
| | | { |
| | | var treasureModel = ModelCenter.Instance.GetModel<TreasureModel>(); |
| | | var treasures = treasureModel.GetAllTreasure(); |
| | | |
| | | for (int i = 0; i < treasures.Count; i++) |
| | | { |
| | | Treasure treasure; |
| | | if (treasureModel.TryGetTreasure(treasures[i], out treasure)) |
| | | { |
| | | _SkillAndPreTreasure[treasure.skillId] = treasures[i]; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void LateUpdate() |
| | | { |
| | | if (BoolFb) |
| | | { |
| | | _currentime += Time.deltaTime; |
| | | if (_currentime >= TimeLong) |
| | | { |
| | | if (AccordingBool) |
| | | { |
| | | DynamicallyCreate(); |
| | | AccordingBool = false; |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | void DynamicallyCreate() |
| | | { |
| | | TipShutDown(SkillsHole); |
| | | switch ((SkillEffects)SkillsHole) |
| | | { |
| | | case SkillEffects.skillEffect_1: |
| | | _LongPressShowPanel = Skill1Info.GetChild(0).GetComponent<LongPressShowPanel>(); |
| | | break; |
| | | case SkillEffects.skillEffect_2: |
| | | _LongPressShowPanel = Skill2Info.GetChild(0).GetComponent<LongPressShowPanel>(); |
| | | break; |
| | | case SkillEffects.skillEffect_3: |
| | | _LongPressShowPanel = Skill3Info.GetChild(0).GetComponent<LongPressShowPanel>(); |
| | | break; |
| | | case SkillEffects.skillEffect_4: |
| | | _LongPressShowPanel = Skill4Info.GetChild(0).GetComponent<LongPressShowPanel>(); |
| | | break; |
| | | case SkillEffects.skillEffect_5: |
| | | _LongPressShowPanel = Skill5Info.GetChild(0).GetComponent<LongPressShowPanel>(); |
| | | break; |
| | | case SkillEffects.skillEffect_6: |
| | | _LongPressShowPanel = Skill6Info.GetChild(0).GetComponent<LongPressShowPanel>(); |
| | | break; |
| | | case SkillEffects.skillEffect_7: |
| | | _LongPressShowPanel = Skill7Info.GetChild(0).GetComponent<LongPressShowPanel>(); |
| | | break; |
| | | case SkillEffects.skillEffect_xp: |
| | | _LongPressShowPanel = XpSkillInfo.GetChild(0).GetComponent<LongPressShowPanel>(); |
| | | break; |
| | | }
|
| | | PlayerSkillData _PlayerSkillData = null; |
| | | if ((SkillEffects)SkillsHole == SkillEffects.skillEffect_xp) |
| | | {
|
| | | var skillModel = ModelCenter.Instance.GetModel<SkillModel>();
|
| | | var xpSkillId = skillModel.GetXpSkillID(); |
| | | _PlayerSkillData = PlayerDatas.Instance.skill.GetSKillById(xpSkillId);
|
| | | } |
| | | else |
| | | { |
| | | _PlayerSkillData = PlayerDatas.Instance.skill.GetQuickSkillByPos(SkillsHole); |
| | | } |
| | | if (!_SkillAndPreTreasure.ContainsKey(_PlayerSkillData.id)) |
| | | { |
| | | DebugEx.LogError("法宝表没有对应的技能ID" + _PlayerSkillData.id); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | int FBID = _SkillAndPreTreasure[_PlayerSkillData.id]; |
| | | _LongPressShowPanel.Name.text = SkillConfig.Get(_PlayerSkillData.id).SkillName; |
| | | _LongPressShowPanel.Describe.text = SkillConfig.Get(_PlayerSkillData.id).Description; |
| | | |
| | | var treasureConfig = TreasureConfig.Get(FBID); |
| | | _LongPressShowPanel.m_Icon.SetSprite(treasureConfig.Icon); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | void TipShutDown(int _index) |
| | | { |
| | | Skill1Info.gameObject.SetActive((SkillEffects)_index == SkillEffects.skillEffect_1); |
| | | Skill2Info.gameObject.SetActive((SkillEffects)_index == SkillEffects.skillEffect_2); |
| | | Skill3Info.gameObject.SetActive((SkillEffects)_index == SkillEffects.skillEffect_3); |
| | | Skill4Info.gameObject.SetActive((SkillEffects)_index == SkillEffects.skillEffect_4); |
| | | Skill5Info.gameObject.SetActive((SkillEffects)_index == SkillEffects.skillEffect_5); |
| | | Skill6Info.gameObject.SetActive((SkillEffects)_index == SkillEffects.skillEffect_6); |
| | | Skill7Info.gameObject.SetActive((SkillEffects)_index == SkillEffects.skillEffect_7); |
| | | XpSkillInfo.gameObject.SetActive((SkillEffects)_index == SkillEffects.skillEffect_xp); |
| | | } |
| | | |
| | | void Prompting(int _Skillindex) |
| | | { |
| | | if (PlayerDatas.Instance.skill.GetQuickSkillByPos(_Skillindex) == null) |
| | | { |
| | | switch ((SkillEffects)_Skillindex) |
| | | { |
| | | case SkillEffects.skillEffect_1: |
| | | SysNotifyMgr.Instance.ShowTip("Skill1Btn_Unlock"); |
| | | break; |
| | | case SkillEffects.skillEffect_2: |
| | | SysNotifyMgr.Instance.ShowTip("Skill2Btn_Unlock"); |
| | | break; |
| | | case SkillEffects.skillEffect_3: |
| | | SysNotifyMgr.Instance.ShowTip("Skill3Btn_Unlock"); |
| | | break; |
| | | case SkillEffects.skillEffect_4: |
| | | SysNotifyMgr.Instance.ShowTip("Skill4Btn_Unlock"); |
| | | break; |
| | | case SkillEffects.skillEffect_5: |
| | | SysNotifyMgr.Instance.ShowTip("Skill5Btn_Unlock"); |
| | | break; |
| | | case SkillEffects.skillEffect_6: |
| | | SysNotifyMgr.Instance.ShowTip("Skill6Btn_Unlock"); |
| | | break; |
| | | case SkillEffects.skillEffect_7: |
| | | SysNotifyMgr.Instance.ShowTip("Skill7Btn_Unlock"); |
| | | break; |
| | | case SkillEffects.skillEffect_xp: |
| | | var skillModel = ModelCenter.Instance.GetModel<SkillModel>(); |
| | | var xpSkillId = skillModel.GetXpSkillID(); |
| | | if (PlayerDatas.Instance.skill.GetSKillById(xpSkillId) == null) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("SkillXpBtn_Unlock"); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | int SkillID = PlayerDatas.Instance.skill.GetQuickSkillByPos(_Skillindex).id; |
| | | Skill _skill = PlayerDatas.Instance.hero.SkillMgr.Get(SkillID); |
| | | if (!_skill.IsValid()) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("SkillBtn_CD"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | private enum SkillEffects |
| | | { |
| | | skillEffect_1 = 0, |
| | | skillEffect_2 = 1, |
| | | skillEffect_3 = 2, |
| | | skillEffect_4 = 3, |
| | | skillEffect_5 = 4, |
| | | skillEffect_6 = 5, |
| | | skillEffect_7 = 6, |
| | | skillEffect_xp = 7, |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | attackEvent.Invoke();
|
| | | }
|
| | |
|
| | | EffectMgr.Instance.PlayUIEffect(1021, 1500, this.transform, false);
|
| | | clickResponse = false;
|
| | | }
|
| | |
|
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | public class MainWinSkillController : Singleton<MainWinSkillController> |
| | | { |
| | | const int SKILL_COUNT_MAX = 7; |
| | | |
| | | public bool enable { get; set; } |
| | | |
| | | public readonly LogicStruct<SkillCD> skillcd0 = new LogicStruct<SkillCD>(); |
| | | public readonly LogicStruct<SkillCD> skillcd1 = new LogicStruct<SkillCD>(); |
| | | public readonly LogicStruct<SkillCD> skillcd2 = new LogicStruct<SkillCD>(); |
| | | public readonly LogicStruct<SkillCD> skillcd3 = new LogicStruct<SkillCD>(); |
| | | public readonly LogicStruct<SkillCD> skillcd4 = new LogicStruct<SkillCD>(); |
| | | public readonly LogicStruct<SkillCD> skillcd5 = new LogicStruct<SkillCD>(); |
| | | public readonly LogicStruct<SkillCD> skillcd6 = new LogicStruct<SkillCD>(); |
| | | public readonly LogicStruct<SkillCD> skillcd7 = new LogicStruct<SkillCD>(); |
| | | public readonly LogicStruct<SkillCD> skillcdxp = new LogicStruct<SkillCD>(); |
| | | |
| | | public readonly LogicBool forbid0 = new LogicBool(); |
| | | public readonly LogicBool forbid1 = new LogicBool(); |
| | | public readonly LogicBool forbid2 = new LogicBool(); |
| | | public readonly LogicBool forbid3 = new LogicBool(); |
| | | public readonly LogicBool forbid4 = new LogicBool(); |
| | | public readonly LogicBool forbid5 = new LogicBool(); |
| | | public readonly LogicBool forbid6 = new LogicBool(); |
| | | public readonly LogicBool forbid7 = new LogicBool(); |
| | | public readonly LogicBool forbidxp = new LogicBool(); |
| | | |
| | | Dictionary<int, int> skillPlaceMap = new Dictionary<int, int>(); |
| | | Dictionary<int, int> placeSkillMap = new Dictionary<int, int>(); |
| | | |
| | | SkillModel model { get { return ModelCenter.Instance.GetModel<SkillModel>(); } } |
| | | |
| | | public MainWinSkillController() |
| | | { |
| | | PlayerSkillDatas.OnRefreshSkill -= OnSkillRefresh; |
| | | Skill.RefreshCD += OnSkillCDRefresh; |
| | | |
| | | GA_Hero.OnStateEnter += OnSkillStateEnter; |
| | | GA_Hero.OnStateEnd += OnSkillStateEnd; |
| | | |
| | | StatusMgr.OnGainCantCastSkillStatus += OnGainCantCastSkillStatus; |
| | | StatusMgr.OnReleaseCantCastSkillStatus += OnReleaseCantCastSkillStatus; |
| | | } |
| | | |
| | | public void InitSkill() |
| | | { |
| | | skillPlaceMap.Clear(); |
| | | placeSkillMap.Clear(); |
| | | for (int i = 0; i < SKILL_COUNT_MAX; i++) |
| | | { |
| | | var skillData = PlayerDatas.Instance.skill.GetQuickSkillByPos(i); |
| | | placeSkillMap[i + 1] = skillData != null ? skillData.id : 0; |
| | | if (skillData != null) |
| | | { |
| | | skillPlaceMap[skillData.id] = i + 1; |
| | | } |
| | | } |
| | | |
| | | var blinkSkill = PlayerDatas.Instance.skill.GetSKillById(190); |
| | | placeSkillMap[0] = blinkSkill != null ? blinkSkill.id : 0; |
| | | if (blinkSkill != null) |
| | | { |
| | | skillPlaceMap[blinkSkill.id] = 0; |
| | | } |
| | | |
| | | var skillXpId = model.GetXpSkillID(); |
| | | var skillXpData = PlayerDatas.Instance.skill.GetSKillById(skillXpId); |
| | | placeSkillMap[8] = skillXpData != null ? skillXpData.id : 0; |
| | | if (skillXpData != null) |
| | | { |
| | | skillPlaceMap[skillXpId] = 8; |
| | | } |
| | | |
| | | if (PlayerDatas.Instance.hero != null) |
| | | { |
| | | foreach (var skillId in skillPlaceMap.Keys) |
| | | { |
| | | var skill = PlayerDatas.Instance.hero.SkillMgr.Get(skillId); |
| | | if (skill != null) |
| | | { |
| | | UpdateSkillExclusiveCountDown(skillId, skill.cd, skill.skillInfo.config.CoolDownTime * Constants.F_GAMMA); |
| | | } |
| | | } |
| | | } |
| | | |
| | | UpdateSkillForbidStates(); |
| | | } |
| | | |
| | | public void Reset() |
| | | { |
| | | skillcd0.value = default(SkillCD); |
| | | skillcd1.value = default(SkillCD); |
| | | skillcd2.value = default(SkillCD); |
| | | skillcd3.value = default(SkillCD); |
| | | skillcd4.value = default(SkillCD); |
| | | skillcd5.value = default(SkillCD); |
| | | skillcd6.value = default(SkillCD); |
| | | skillcd7.value = default(SkillCD); |
| | | skillcdxp.value = default(SkillCD); |
| | | |
| | | forbid0.value = false; |
| | | forbid1.value = false; |
| | | forbid2.value = false; |
| | | forbid3.value = false; |
| | | forbid4.value = false; |
| | | forbid5.value = false; |
| | | forbid6.value = false; |
| | | forbid7.value = false; |
| | | forbidxp.value = false; |
| | | |
| | | skillPlaceMap.Clear(); |
| | | placeSkillMap.Clear(); |
| | | } |
| | | |
| | | public LogicStruct<SkillCD> GetSkillCD(int index) |
| | | { |
| | | switch (index) |
| | | { |
| | | case 0: |
| | | return skillcd0; |
| | | case 1: |
| | | return skillcd1; |
| | | case 2: |
| | | return skillcd2; |
| | | case 3: |
| | | return skillcd3; |
| | | case 4: |
| | | return skillcd4; |
| | | case 5: |
| | | return skillcd5; |
| | | case 6: |
| | | return skillcd6; |
| | | case 7: |
| | | return skillcd7; |
| | | case 8: |
| | | return skillcdxp; |
| | | default: |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public LogicBool GetSkillForbid(int index) |
| | | { |
| | | switch (index) |
| | | { |
| | | case 0: |
| | | return forbid0; |
| | | case 1: |
| | | return forbid1; |
| | | case 2: |
| | | return forbid2; |
| | | case 3: |
| | | return forbid3; |
| | | case 4: |
| | | return forbid4; |
| | | case 5: |
| | | return forbid5; |
| | | case 6: |
| | | return forbid6; |
| | | case 7: |
| | | return forbid7; |
| | | case 8: |
| | | return forbidxp; |
| | | default: |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | private void OnSkillRefresh() |
| | | { |
| | | InitSkill(); |
| | | } |
| | | |
| | | private void OnSkillCDRefresh(int skillId, float cd, float total) |
| | | { |
| | | UpdateSkillExclusiveCountDown(skillId, cd, total); |
| | | } |
| | | |
| | | private void OnSkillStateEnter(float time) |
| | | { |
| | | UpdateSkillCommonCountDown(time); |
| | | } |
| | | |
| | | private void OnSkillStateEnd() |
| | | { |
| | | UpdateSkillCommonCountDown(0); |
| | | } |
| | | |
| | | private void OnGainCantCastSkillStatus(float duration) |
| | | { |
| | | UpdateSkillForbidStates(); |
| | | } |
| | | |
| | | private void OnReleaseCantCastSkillStatus() |
| | | { |
| | | UpdateSkillForbidStates(); |
| | | } |
| | | |
| | | private void UpdateSkillExclusiveCountDown(int skillId, float cd, float total) |
| | | { |
| | | if (skillPlaceMap.ContainsKey(skillId)) |
| | | { |
| | | var place = skillPlaceMap[skillId]; |
| | | var skillcd = GetSkillCD(place); |
| | | skillcd.value = skillcd.value.SetExclusiveCountDown(cd, total); |
| | | } |
| | | } |
| | | |
| | | private void UpdateSkillCommonCountDown(float time) |
| | | { |
| | | for (int i = 0; i <= 8; i++) |
| | | { |
| | | if (placeSkillMap.ContainsKey(i) && placeSkillMap[i] != 0) |
| | | { |
| | | var skillcd = GetSkillCD(i); |
| | | skillcd.value = skillcd.value.SetCommonCountDown(time); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void UpdateSkillForbidStates() |
| | | { |
| | | var forbid = !StatusMgr.Instance.CanCastSkill(PlayerDatas.Instance.baseData.PlayerID); |
| | | for (int i = 0; i <= 8; i++) |
| | | { |
| | | var skillForbid = GetSkillForbid(i); |
| | | skillForbid.value = forbid; |
| | | } |
| | | } |
| | | |
| | | public struct SkillCD |
| | | { |
| | | public float exclusiveTotal; |
| | | public float exclusiveOverTime; |
| | | public float commonTotal; |
| | | public float commonOverTime; |
| | | |
| | | public SkillCD SetCommonCountDown(float time) |
| | | { |
| | | commonTotal = time; |
| | | commonOverTime = Time.realtimeSinceStartup + time; |
| | | |
| | | return this; |
| | | } |
| | | |
| | | public SkillCD SetExclusiveCountDown(float cd, float total) |
| | | { |
| | | exclusiveTotal = total; |
| | | exclusiveOverTime = Time.realtimeSinceStartup + cd; |
| | | |
| | | return this; |
| | | } |
| | | |
| | | public bool IsCountDown() |
| | | { |
| | | if (exclusiveOverTime > Time.realtimeSinceStartup) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | if (commonOverTime > Time.realtimeSinceStartup) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | public float GetCountDownFillAmount() |
| | | { |
| | | if (exclusiveOverTime > Time.realtimeSinceStartup) |
| | | { |
| | | return (exclusiveOverTime - Time.realtimeSinceStartup) / exclusiveTotal; |
| | | } |
| | | |
| | | if (commonOverTime > Time.realtimeSinceStartup) |
| | | { |
| | | return (commonOverTime - Time.realtimeSinceStartup) / commonTotal; |
| | | } |
| | | |
| | | return 0f; |
| | | } |
| | | |
| | | public float GetCountDown() |
| | | { |
| | | if (exclusiveOverTime > Time.realtimeSinceStartup) |
| | | { |
| | | return exclusiveOverTime - Time.realtimeSinceStartup; |
| | | } |
| | | |
| | | return 0f; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 78c5929158f09c74dbdc5e481afcb400 |
| | | timeCreated: 1555070239 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine.UI; |
| | | |
| | | using UnityEngine.EventSystems; |
| | | using UnityEngine.Events; |
| | | |
| | |
| | | |
| | | public class SkillButton : SkillButtonInterface, IPointerExitHandler |
| | | { |
| | | [SerializeField] int m_Index; |
| | | [SerializeField] SkillTurnplate m_SkillTurnplate; |
| | | [SerializeField] Image m_Icon; |
| | | public Image icon { get { return m_Icon; } } |
| | | [SerializeField] ImageEx m_Icon; |
| | | [SerializeField] Transform m_Locked; |
| | | public Transform locked |
| | | { |
| | | get |
| | | { |
| | | return m_Locked; |
| | | } |
| | | } |
| | | |
| | | [SerializeField] Text m_CoolDown; |
| | | [SerializeField] Image m_CoolDownMask; |
| | | [SerializeField] ScaleTween m_ScaleTween; |
| | | [SerializeField] Image m_Selected; |
| | | [SerializeField] LongPressShowPanel m_SkillTip; |
| | | |
| | | [Header("遮罩是否反向")] |
| | | public bool Isreverse = false; |
| | | public Image icon { get { return m_Icon; } } |
| | | public Transform locked { get { return m_Locked; } } |
| | | |
| | | UIEvent skillEvent1 = new UIEvent(); |
| | | UIEvent skillEvent2 = new UIEvent(); |
| | | |
| | | bool isExit = false; |
| | | |
| | | float m_TotalCoolDown = 0f; |
| | | public float totalCoolDown |
| | | { |
| | | get |
| | | { |
| | | return m_TotalCoolDown; |
| | | } |
| | | set |
| | | { |
| | | m_TotalCoolDown = value; |
| | | } |
| | | } |
| | | |
| | | float m_CoolDownCompleteTime = 0f; |
| | | public float coolDownCompleteTime |
| | | { |
| | | get |
| | | { |
| | | return m_CoolDownCompleteTime; |
| | | } |
| | | set |
| | | { |
| | | m_CoolDownCompleteTime = value; |
| | | } |
| | | } |
| | | |
| | | bool inCountDown = false; |
| | | float timer = 0f; |
| | | PlayerSkillData m_SkillData = null; |
| | | Skill skillBuf = null; |
| | | float fillAmountRevise = 1f; |
| | | int skillId = 0; |
| | | |
| | | public void SetSkillData(PlayerSkillData _skillData) |
| | | public void Initialize(int skillId) |
| | | { |
| | | m_SkillData = _skillData; |
| | | if (m_SkillData == null) |
| | | this.skillId = skillId; |
| | | if (this.skillId == 0) |
| | | { |
| | | locked.gameObject.SetActive(true); |
| | | m_Icon.gameObject.SetActive(false); |
| | |
| | | locked.gameObject.SetActive(false); |
| | | m_Icon.gameObject.SetActive(true); |
| | | } |
| | | var skillConfig = m_SkillData.skillCfg; |
| | | |
| | | var skillConfig = SkillConfig.Get(this.skillId); |
| | | m_Icon.SetSprite(skillConfig.IconName); |
| | | |
| | | if (skillBuf != null) |
| | | { |
| | | skillBuf.RefreshCD -= OnSkillCDRefresh; |
| | | } |
| | | |
| | | if (PlayerDatas.Instance.hero != null) |
| | | { |
| | | skillBuf = PlayerDatas.Instance.hero.SkillMgr.Get(m_SkillData.id); |
| | | OnSkillCDRefresh(skillBuf.cd, skillBuf.skillInfo.config.CoolDownTime * Constants.F_GAMMA); |
| | | skillBuf.RefreshCD += OnSkillCDRefresh; |
| | | } |
| | | } |
| | | |
| | | DisplaySkillDynamicInfo(true); |
| | | m_Selected.gameObject.SetActive(false); |
| | | HideSkillTip(); |
| | | |
| | | this.enabled = true; |
| | | } |
| | | |
| | | public void Dispose() |
| | | { |
| | | if (skillBuf != null) |
| | | if (showSkillTipClock != null) |
| | | { |
| | | skillBuf.RefreshCD -= OnSkillCDRefresh; |
| | | Clock.Stop(showSkillTipClock); |
| | | showSkillTipClock = null; |
| | | } |
| | | |
| | | if (m_Index != 0) |
| | | { |
| | | HideSkillTip(); |
| | | } |
| | | |
| | | this.enabled = false; |
| | | } |
| | | |
| | | public void AddDownListener(UnityAction _action) |
| | |
| | | skillEvent2.RemoveAllListeners(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 剩余CD和总CD都是毫秒 |
| | | /// </summary> |
| | | /// <param name="_cd"></param> |
| | | /// <param name="_totalCD"></param> |
| | | private void OnSkillCDRefresh(float _cd, float _totalCD) |
| | | { |
| | | totalCoolDown = _totalCD; |
| | | coolDownCompleteTime = Time.time + _cd; |
| | | timer = 0f; |
| | | } |
| | | |
| | | private void LateUpdate() |
| | | { |
| | | if (m_CoolDownCompleteTime > Time.time) |
| | | DisplaySkillDynamicInfo(false); |
| | | |
| | | if (inCountDown) |
| | | { |
| | | var cd = m_CoolDownCompleteTime - Time.time; |
| | | if (!m_CoolDown.gameObject.activeInHierarchy) |
| | | if (!m_CoolDown.gameObject.activeSelf) |
| | | { |
| | | m_CoolDown.gameObject.SetActive(true); |
| | | } |
| | | |
| | | if (m_CoolDownMask != null && !m_CoolDownMask.gameObject.activeInHierarchy) |
| | | if (m_CoolDownMask != null && !m_CoolDownMask.gameObject.activeSelf) |
| | | { |
| | | m_CoolDownMask.gameObject.SetActive(true); |
| | | } |
| | | |
| | | if (m_CoolDownMask != null) |
| | | { |
| | | if (Isreverse) |
| | | { |
| | | float flo = cd / totalCoolDown; |
| | | m_CoolDownMask.fillAmount = 1.0f - flo; |
| | | } |
| | | else |
| | | { |
| | | m_CoolDownMask.fillAmount = cd / totalCoolDown; |
| | | } |
| | | m_CoolDownMask.fillAmount = MainWinSkillController.Instance.GetSkillCD(m_Index).value.GetCountDownFillAmount(); |
| | | } |
| | | |
| | | timer -= Time.deltaTime; |
| | | if (timer < 0f) |
| | | { |
| | | m_CoolDown.text = cd.ToString("f0"); |
| | | var countDown = MainWinSkillController.Instance.GetSkillCD(m_Index).value.GetCountDown(); |
| | | if (countDown > 1) |
| | | { |
| | | m_CoolDown.text = countDown.ToString("f0"); |
| | | } |
| | | else |
| | | { |
| | | m_CoolDown.text = ""; |
| | | } |
| | | |
| | | timer += 1f; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (m_CoolDown.gameObject.activeInHierarchy) |
| | | if (m_CoolDown.gameObject.activeSelf) |
| | | { |
| | | m_CoolDown.gameObject.SetActive(false); |
| | | } |
| | | |
| | | if (m_CoolDownMask != null) |
| | | { |
| | | if (Isreverse) |
| | | if (m_CoolDownMask.gameObject.activeSelf) |
| | | { |
| | | m_CoolDownMask.fillAmount = 1; |
| | | } |
| | | else |
| | | { |
| | | if (m_CoolDownMask.gameObject.activeInHierarchy) |
| | | { |
| | | m_CoolDownMask.gameObject.SetActive(false); |
| | | } |
| | | m_CoolDownMask.gameObject.SetActive(false); |
| | | } |
| | | } |
| | | |
| | |
| | | public override void OnPointerDown(PointerEventData eventData) |
| | | { |
| | | base.OnPointerDown(eventData); |
| | | |
| | | ProcessForbid(); |
| | | PassEvent(eventData, ExecuteEvents.pointerDownHandler); |
| | | |
| | | if (m_SkillData == null) |
| | | if (this.skillId == 0) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (m_ScaleTween != null) |
| | | { |
| | | m_ScaleTween.Play(); |
| | | } |
| | | |
| | | skillEvent1.Invoke(); |
| | | isExit = false; |
| | | m_Selected.gameObject.SetActive(true); |
| | | |
| | | skillEvent1.Invoke(); |
| | | |
| | | if (m_Index != 0) |
| | | { |
| | | if (showSkillTipClock != null) |
| | | { |
| | | Clock.Stop(showSkillTipClock); |
| | | } |
| | | |
| | | showSkillTipClock = Clock.AlarmAfter(1, ShowSkillTip); |
| | | } |
| | | |
| | | isExit = false; |
| | | } |
| | | |
| | | public override void OnPointerUp(PointerEventData eventData) |
| | |
| | | |
| | | PassEvent(eventData, ExecuteEvents.pointerUpHandler); |
| | | |
| | | if (m_SkillData == null) |
| | | if (this.skillId == 0) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (m_ScaleTween != null) |
| | | { |
| | | m_ScaleTween.Play(true); |
| | | } |
| | | |
| | | m_Selected.gameObject.SetActive(false); |
| | | |
| | | if (isExit == false) |
| | | { |
| | | skillEvent2.Invoke(); |
| | | } |
| | | |
| | | if (showSkillTipClock != null) |
| | | { |
| | | Clock.Stop(showSkillTipClock); |
| | | showSkillTipClock = null; |
| | | } |
| | | |
| | | if (m_Index != 0) |
| | | { |
| | | HideSkillTip(); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | private void Awake() |
| | | { |
| | | Skill.OnSkillCDFinished += OnSkillPrepared; |
| | | Skill.OnSkillCast += OnSkillCast; |
| | | } |
| | | |
| | | private void OnDestroy() |
| | | { |
| | | Skill.OnSkillCDFinished += OnSkillPrepared; |
| | | Skill.OnSkillCast += OnSkillCast; |
| | | } |
| | | |
| | | private void OnSkillPrepared(int skillId) |
| | | { |
| | | if (!this.enabled) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (this.skillId != skillId) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | EffectMgr.Instance.PlayUIEffect(1024, 1500, this.transform, false); |
| | | } |
| | | |
| | | private void OnSkillCast(uint playerInstanceId, int skillId) |
| | | { |
| | | if (!this.enabled) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (playerInstanceId != PlayerDatas.Instance.PlayerId) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (this.skillId != skillId) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | EffectMgr.Instance.PlayUIEffect(1023, 1500, this.transform, false); |
| | | } |
| | | |
| | | private void ProcessForbid() |
| | | { |
| | | var isUnLocked = this.skillId != 0; |
| | | if (!isUnLocked) |
| | | { |
| | | switch (m_Index) |
| | | { |
| | | case 1: |
| | | SysNotifyMgr.Instance.ShowTip("Skill1Btn_Unlock"); |
| | | break; |
| | | case 2: |
| | | SysNotifyMgr.Instance.ShowTip("Skill2Btn_Unlock"); |
| | | break; |
| | | case 3: |
| | | SysNotifyMgr.Instance.ShowTip("Skill3Btn_Unlock"); |
| | | break; |
| | | case 4: |
| | | SysNotifyMgr.Instance.ShowTip("Skill4Btn_Unlock"); |
| | | break; |
| | | case 5: |
| | | SysNotifyMgr.Instance.ShowTip("Skill5Btn_Unlock"); |
| | | break; |
| | | case 6: |
| | | SysNotifyMgr.Instance.ShowTip("Skill6Btn_Unlock"); |
| | | break; |
| | | case 7: |
| | | SysNotifyMgr.Instance.ShowTip("Skill7Btn_Unlock"); |
| | | break; |
| | | case 8: |
| | | SysNotifyMgr.Instance.ShowTip("SkillXpBtn_Unlock"); |
| | | break; |
| | | } |
| | | |
| | | return; |
| | | } |
| | | |
| | | if (PlayerDatas.Instance.hero == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var skill = PlayerDatas.Instance.hero.SkillMgr.Get(this.skillId); |
| | | if (!skill.IsValid()) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("SkillBtn_CD"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | Clock showSkillTipClock; |
| | | private void ShowSkillTip() |
| | | { |
| | | if (this.skillId == 0) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (m_SkillTip) |
| | | { |
| | | m_SkillTip.gameObject.SetActive(true); |
| | | m_SkillTip.Display(this.skillId); |
| | | } |
| | | } |
| | | |
| | | private void HideSkillTip() |
| | | { |
| | | if (m_SkillTip) |
| | | { |
| | | m_SkillTip.gameObject.SetActive(false); |
| | | } |
| | | } |
| | | |
| | | private void DisplaySkillDynamicInfo(bool force) |
| | | { |
| | | var skillCd = MainWinSkillController.Instance.GetSkillCD(m_Index); |
| | | if (force || skillCd.dirty) |
| | | { |
| | | var data = skillCd.Fetch(); |
| | | inCountDown = data.IsCountDown(); |
| | | |
| | | var countDown = MainWinSkillController.Instance.GetSkillCD(m_Index).value.GetCountDown(); |
| | | if (countDown > 0) |
| | | { |
| | | m_CoolDown.text = countDown.ToString("f0"); |
| | | } |
| | | else |
| | | { |
| | | m_CoolDown.text = ""; |
| | | } |
| | | } |
| | | |
| | | var skillForbid = MainWinSkillController.Instance.GetSkillForbid(m_Index); |
| | | if (force || skillForbid.dirty) |
| | | { |
| | | m_Icon.gray = skillForbid.Fetch(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | // [ Date ]: Saturday, September 02, 2017 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | |
| | | using UnityEngine.UI; |
| | | using System.Collections.Generic; |
| | | |
| | |
| | | public SkillButton skillXP { get { return m_SkillXP; } } |
| | | |
| | | const int SKILL_COUNT_MAX = 8; |
| | | Dictionary<int, PlayerSkillData> indexSkillDataDict = new Dictionary<int, PlayerSkillData>(); |
| | | Dictionary<int, int> indexSkillDataDict = new Dictionary<int, int>(); |
| | | |
| | | public void Init() |
| | | { |
| | |
| | | m_Skill7.AddUpListener(PrepareCastSkill7); |
| | | m_SkillXP.AddUpListener(PrepareCastSkillXp); |
| | | |
| | | MainWinSkillController.Instance.InitSkill(); |
| | | OnSkillRefresh(); |
| | | HandleAchievement(); |
| | | PlayerSkillDatas.OnRefreshSkill += OnSkillRefresh; |
| | |
| | | m_Skill5.RemoveAllListeners(); |
| | | m_Skill6.RemoveAllListeners(); |
| | | m_Skill7.RemoveAllListeners(); |
| | | skillXP.RemoveAllListeners(); |
| | | skillXP.RemoveAllListeners();
|
| | |
|
| | | m_BlinkSkill.Dispose(); |
| | | m_Skill1.Dispose(); |
| | | m_Skill2.Dispose(); |
| | | m_Skill3.Dispose(); |
| | | m_Skill4.Dispose(); |
| | | m_Skill5.Dispose(); |
| | | m_Skill6.Dispose(); |
| | | m_Skill7.Dispose(); |
| | | skillXP.Dispose(); |
| | | |
| | | PlayerSkillDatas.OnRefreshSkill -= OnSkillRefresh; |
| | | if (AchievementGoto.achievementType == AchievementGoto.ExcuteSkill) |
| | | { |
| | |
| | | { |
| | | for (int i = 0; i < SKILL_COUNT_MAX; i++) |
| | | { |
| | | indexSkillDataDict[i] = PlayerDatas.Instance.skill.GetQuickSkillByPos(i); |
| | | var skillData = PlayerDatas.Instance.skill.GetQuickSkillByPos(i); |
| | | indexSkillDataDict[i] = skillData == null ? 0 : skillData.id; |
| | | } |
| | | |
| | | m_Skill1.SetSkillData(indexSkillDataDict[0]); |
| | | m_Skill2.SetSkillData(indexSkillDataDict[1]); |
| | | m_Skill3.SetSkillData(indexSkillDataDict[2]); |
| | | m_Skill4.SetSkillData(indexSkillDataDict[3]); |
| | | m_Skill5.SetSkillData(indexSkillDataDict[4]); |
| | | m_Skill6.SetSkillData(indexSkillDataDict[5]); |
| | | m_Skill7.SetSkillData(indexSkillDataDict[6]); |
| | | m_Skill1.Initialize(indexSkillDataDict[0]); |
| | | m_Skill2.Initialize(indexSkillDataDict[1]); |
| | | m_Skill3.Initialize(indexSkillDataDict[2]); |
| | | m_Skill4.Initialize(indexSkillDataDict[3]); |
| | | m_Skill5.Initialize(indexSkillDataDict[4]); |
| | | m_Skill6.Initialize(indexSkillDataDict[5]); |
| | | m_Skill7.Initialize(indexSkillDataDict[6]); |
| | | |
| | | m_BlinkSkill.SetSkillData(PlayerDatas.Instance.skill.GetSKillById(190)); |
| | | var blinkSkillData = PlayerDatas.Instance.skill.GetSKillById(190); |
| | | m_BlinkSkill.Initialize(blinkSkillData == null ? 0 : blinkSkillData.id); |
| | | |
| | | var model = ModelCenter.Instance.GetModel<SkillModel>();
|
| | | var skillXpId = model.GetXpSkillID(); |
| | | m_SkillXP.SetSkillData(PlayerDatas.Instance.skill.GetSKillById(skillXpId)); |
| | | var skillXpId = model.GetXpSkillID();
|
| | | var skillXpData = PlayerDatas.Instance.skill.GetSKillById(skillXpId); |
| | | m_SkillXP.Initialize(skillXpData != null ? skillXpId : 0);
|
| | | } |
| | | |
| | | void SwitchTarget() |
| | |
| | | |
| | | void CastSkill1() |
| | | { |
| | | if (indexSkillDataDict[0] == null) |
| | | if (indexSkillDataDict[0] == 0) |
| | | { |
| | | DebugEx.Log("技能未解锁"); |
| | | return; |
| | | } |
| | | |
| | | DoCastSkill(indexSkillDataDict[0].id); |
| | | |
| | | DoCastSkill(indexSkillDataDict[0]); |
| | | } |
| | | |
| | | void CastSkill2() |
| | | { |
| | | |
| | | if (indexSkillDataDict[1] == null) |
| | | if (indexSkillDataDict[1] == 0) |
| | | { |
| | | DebugEx.Log("技能未解锁"); |
| | | return; |
| | | } |
| | | |
| | | DoCastSkill(indexSkillDataDict[1].id); |
| | | DoCastSkill(indexSkillDataDict[1]); |
| | | } |
| | | |
| | | void CastSkill3() |
| | | { |
| | | |
| | | if (indexSkillDataDict[2] == null) |
| | | if (indexSkillDataDict[2] == 0) |
| | | { |
| | | DebugEx.Log("技能未解锁"); |
| | | return; |
| | | } |
| | | |
| | | DoCastSkill(indexSkillDataDict[2].id); |
| | | DoCastSkill(indexSkillDataDict[2]); |
| | | } |
| | | |
| | | void CastSkill4() |
| | | { |
| | | |
| | | if (indexSkillDataDict[3] == null) |
| | | if (indexSkillDataDict[3] == 0) |
| | | { |
| | | DebugEx.Log("技能未解锁"); |
| | | return; |
| | | } |
| | | |
| | | DoCastSkill(indexSkillDataDict[3].id); |
| | | DoCastSkill(indexSkillDataDict[3]); |
| | | } |
| | | |
| | | void CastSkill5() |
| | | { |
| | | |
| | | if (indexSkillDataDict[4] == null) |
| | | if (indexSkillDataDict[4] == 0) |
| | | { |
| | | DebugEx.Log("技能未解锁"); |
| | | return; |
| | | } |
| | | |
| | | DoCastSkill(indexSkillDataDict[4].id); |
| | | DoCastSkill(indexSkillDataDict[4]); |
| | | } |
| | | |
| | | void CastSkill6() |
| | | { |
| | | |
| | | if (indexSkillDataDict[5] == null) |
| | | if (indexSkillDataDict[5] == 0) |
| | | { |
| | | DebugEx.Log("技能未解锁"); |
| | | return; |
| | | } |
| | | |
| | | DoCastSkill(indexSkillDataDict[5].id); |
| | | DoCastSkill(indexSkillDataDict[5]); |
| | | } |
| | | |
| | | void CastSkill7() |
| | | { |
| | | |
| | | if (indexSkillDataDict[6] == null) |
| | | if (indexSkillDataDict[6] == 0) |
| | | { |
| | | DebugEx.Log("技能未解锁"); |
| | | return; |
| | | } |
| | | |
| | | DoCastSkill(indexSkillDataDict[6].id); |
| | | DoCastSkill(indexSkillDataDict[6]); |
| | | } |
| | | |
| | | void CastSkillXp() |
| | |
| | | DebugEx.Log("技能未解锁");
|
| | | return;
|
| | | }
|
| | | DoCastSkill(skillXpId); |
| | | DoCastSkill(skillXpId);
|
| | | } |
| | | |
| | | void PrepareCastSkill1() |
| | | { |
| | | if (indexSkillDataDict[0] == null) |
| | | if (indexSkillDataDict[0] == 0) |
| | | { |
| | | DebugEx.Log("技能未解锁"); |
| | | return; |
| | | } |
| | | |
| | | DoPrepareCast(indexSkillDataDict[0].id); |
| | | DoPrepareCast(indexSkillDataDict[0]); |
| | | } |
| | | |
| | | void PrepareCastSkill2() |
| | | { |
| | | |
| | | if (indexSkillDataDict[1] == null) |
| | | if (indexSkillDataDict[1] == 0) |
| | | { |
| | | DebugEx.Log("技能未解锁"); |
| | | return; |
| | | } |
| | | |
| | | DoPrepareCast(indexSkillDataDict[1].id); |
| | | DoPrepareCast(indexSkillDataDict[1]); |
| | | } |
| | | |
| | | void PrepareCastSkill3() |
| | | { |
| | | |
| | | if (indexSkillDataDict[2] == null) |
| | | if (indexSkillDataDict[2] == 0) |
| | | { |
| | | DebugEx.Log("技能未解锁"); |
| | | return; |
| | | } |
| | | |
| | | DoPrepareCast(indexSkillDataDict[2].id); |
| | | DoPrepareCast(indexSkillDataDict[2]); |
| | | } |
| | | |
| | | void PrepareCastSkill4() |
| | | { |
| | | if (indexSkillDataDict[3] == null) |
| | | if (indexSkillDataDict[3] == 0) |
| | | { |
| | | DebugEx.Log("技能未解锁"); |
| | | return; |
| | | } |
| | | |
| | | DoPrepareCast(indexSkillDataDict[3].id); |
| | | DoPrepareCast(indexSkillDataDict[3]); |
| | | } |
| | | |
| | | void PrepareCastSkill5() |
| | | { |
| | | if (indexSkillDataDict[4] == null) |
| | | if (indexSkillDataDict[4] == 0) |
| | | { |
| | | DebugEx.Log("技能未解锁"); |
| | | return; |
| | | } |
| | | |
| | | DoPrepareCast(indexSkillDataDict[4].id); |
| | | DoPrepareCast(indexSkillDataDict[4]); |
| | | } |
| | | |
| | | void PrepareCastSkill6() |
| | | { |
| | | if (indexSkillDataDict[5] == null) |
| | | if (indexSkillDataDict[5] == 0) |
| | | { |
| | | DebugEx.Log("技能未解锁"); |
| | | return; |
| | | } |
| | | |
| | | DoPrepareCast(indexSkillDataDict[5].id); |
| | | DoPrepareCast(indexSkillDataDict[5]); |
| | | } |
| | | |
| | | void PrepareCastSkill7() |
| | | { |
| | | if (indexSkillDataDict[6] == null) |
| | | if (indexSkillDataDict[6] == 0) |
| | | { |
| | | DebugEx.Log("技能未解锁"); |
| | | return; |
| | | } |
| | | |
| | | DoPrepareCast(indexSkillDataDict[6].id); |
| | | DoPrepareCast(indexSkillDataDict[6]); |
| | | } |
| | | |
| | | void PrepareCastSkillXp() |
| | |
| | | DisplayFunctionUnLock(config.Condition);
|
| | | if (config.Steps == null || config.Steps.Length == 0)
|
| | | {
|
| | | Clock.Create(5,
|
| | | Clock.AlarmAfter(5,
|
| | | () =>
|
| | | {
|
| | | var guideId = config.ID;
|
| | |
| | | Dictionary<int, int> m_MainReikiRoots = new Dictionary<int, int>();
|
| | | Dictionary<int, int> m_ReikiQualityMapColors;
|
| | | Dictionary<int, int> m_CacheReikiRootPoints = new Dictionary<int, int>();
|
| | | Dictionary<int, Dictionary<int, int[]>> m_PromotePropertyValues = new Dictionary<int, Dictionary<int, int[]>>();
|
| | |
|
| | | public List<int> reikiRoots = new List<int>();
|
| | |
|
| | |
| | | reikiRoots.Add((int)PropertyType.Fire);
|
| | | reikiRoots.Add((int)PropertyType.Earth);
|
| | |
|
| | | var configs = ReikiRootConfig.GetValues();
|
| | | foreach (var _config in configs)
|
| | | {
|
| | | m_PromotePropertyValues.Add(_config.id, new Dictionary<int, int[]>());
|
| | | var _json = LitJson.JsonMapper.ToObject(_config.promoteValue);
|
| | | foreach (var _jobKey in _json.Keys)
|
| | | {
|
| | | var job = int.Parse(_jobKey);
|
| | | m_PromotePropertyValues[_config.id].Add(job,
|
| | | LitJson.JsonMapper.ToObject<int[]>(_json[_jobKey].ToJson()));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public int GetReikiRootQuality(int id, int point)
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | m_CacheReikiRootPoints.Clear();
|
| | | foreach (var id in m_ReikiRootPoints.Keys)
|
| | | {
|
| | | m_CacheReikiRootPoints[id] = m_ReikiRootPoints[id];
|
| | | }
|
| | | //m_CacheReikiRootPoints.Clear();
|
| | | //foreach (var id in m_ReikiRootPoints.Keys)
|
| | | //{
|
| | | // m_CacheReikiRootPoints[id] = m_ReikiRootPoints[id];
|
| | | //}
|
| | |
|
| | | var recommends = new List<ReikiRootRecommend>();
|
| | | var job = PlayerDatas.Instance.baseData.Job;
|
| | | var remainPoint = point;
|
| | | var currentMaxQuality = 1;
|
| | |
|
| | | foreach (var id in reikiRoots)
|
| | | if (m_RecommendProportion.ContainsKey(job))
|
| | | {
|
| | | var quality = GetReikiRootQuality(id);
|
| | | if (quality >= currentMaxQuality)
|
| | | var proportions = m_RecommendProportion[job];
|
| | | var index = 0;
|
| | | var surplusPoint = point;
|
| | | foreach (var id in proportions.Keys)
|
| | | {
|
| | | currentMaxQuality = quality;
|
| | | var recommendPoint = Mathf.Min(surplusPoint, (int)(point * proportions[id]));
|
| | | if (index == proportions.Keys.Count - 1)
|
| | | {
|
| | | recommendPoint = surplusPoint;
|
| | | }
|
| | | recommends.Add(new ReikiRootRecommend()
|
| | | {
|
| | | id = id,
|
| | | value = recommendPoint,
|
| | | });
|
| | | surplusPoint -= recommendPoint;
|
| | | index++;
|
| | | }
|
| | | }
|
| | |
|
| | | if (m_RecommendReikiRoots.ContainsKey(job))
|
| | | {
|
| | | var reikiRoots = m_RecommendReikiRoots[job];
|
| | | while (remainPoint > 0)
|
| | | {
|
| | | reikiRoots.Sort(QualityCompare);
|
| | | var id = reikiRoots[0];
|
| | | var quality = GetReikiRootQuality(id, m_CacheReikiRootPoints[id]);
|
| | | var addpoint = 0;
|
| | | if (quality >= maxQuality)
|
| | | {
|
| | | var proportions = m_RecommendProportion[job];
|
| | | foreach (var key in proportions.Keys)
|
| | | {
|
| | | addpoint = Mathf.RoundToInt(remainPoint * proportions[key]);
|
| | | recommends.Add(new ReikiRootRecommend()
|
| | | {
|
| | | id = key,
|
| | | value = addpoint,
|
| | | });
|
| | | if (!m_CacheReikiRootPoints.ContainsKey(key))
|
| | | {
|
| | | m_CacheReikiRootPoints.Add(key, 0);
|
| | | }
|
| | | m_CacheReikiRootPoints[key] += addpoint;
|
| | | }
|
| | | remainPoint = 0;
|
| | | }
|
| | | else
|
| | | {
|
| | | addpoint = Mathf.Min(remainPoint, GetCacheQualityRequrePoint(id,
|
| | | quality < currentMaxQuality ? currentMaxQuality : quality + 1));
|
| | | remainPoint -= addpoint;
|
| | | recommends.Add(new ReikiRootRecommend()
|
| | | {
|
| | | id = id,
|
| | | value = addpoint,
|
| | | });
|
| | | if (!m_CacheReikiRootPoints.ContainsKey(id))
|
| | | {
|
| | | m_CacheReikiRootPoints.Add(id, 0);
|
| | | }
|
| | | m_CacheReikiRootPoints[id] += addpoint;
|
| | | }
|
| | | }
|
| | | }
|
| | | //var remainPoint = point;
|
| | | //var currentMaxQuality = 1;
|
| | |
|
| | | //foreach (var id in reikiRoots)
|
| | | //{
|
| | | // var quality = GetReikiRootQuality(id);
|
| | | // if (quality >= currentMaxQuality)
|
| | | // {
|
| | | // currentMaxQuality = quality;
|
| | | // }
|
| | | //}
|
| | | //
|
| | | //if (m_RecommendReikiRoots.ContainsKey(job))
|
| | | //{
|
| | | // var reikiRoots = m_RecommendReikiRoots[job];
|
| | | // while (remainPoint > 0)
|
| | | // {
|
| | | // reikiRoots.Sort(QualityCompare);
|
| | | // var id = reikiRoots[0];
|
| | | // var quality = GetReikiRootQuality(id, m_CacheReikiRootPoints[id]);
|
| | | // var addpoint = 0;
|
| | | // if (quality >= maxQuality)
|
| | | // {
|
| | | // var proportions = m_RecommendProportion[job];
|
| | | // foreach (var key in proportions.Keys)
|
| | | // {
|
| | | // addpoint = Mathf.RoundToInt(remainPoint * proportions[key]);
|
| | | // recommends.Add(new ReikiRootRecommend()
|
| | | // {
|
| | | // id = key,
|
| | | // value = addpoint,
|
| | | // });
|
| | | // if (!m_CacheReikiRootPoints.ContainsKey(key))
|
| | | // {
|
| | | // m_CacheReikiRootPoints.Add(key, 0);
|
| | | // }
|
| | | // m_CacheReikiRootPoints[key] += addpoint;
|
| | | // }
|
| | | // remainPoint = 0;
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // addpoint = Mathf.Min(remainPoint, GetCacheQualityRequrePoint(id,
|
| | | // quality < currentMaxQuality ? currentMaxQuality : quality + 1));
|
| | | // remainPoint -= addpoint;
|
| | | // recommends.Add(new ReikiRootRecommend()
|
| | | // {
|
| | | // id = id,
|
| | | // value = addpoint,
|
| | | // });
|
| | | // if (!m_CacheReikiRootPoints.ContainsKey(id))
|
| | | // {
|
| | | // m_CacheReikiRootPoints.Add(id, 0);
|
| | | // }
|
| | | // m_CacheReikiRootPoints[id] += addpoint;
|
| | | // }
|
| | | // }
|
| | | //}
|
| | | return recommends;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | propertyDict[config.propertyPerPoint.x] += config.propertyPerPoint.y * point;
|
| | |
|
| | | if (!propertyDict.ContainsKey(config.promoteProperty))
|
| | | var job = PlayerDatas.Instance.baseData.Job;
|
| | | var promotePropertyId = config.GetPromotePropertyId(job);
|
| | |
|
| | | if (!propertyDict.ContainsKey(promotePropertyId))
|
| | | {
|
| | | propertyDict.Add(config.promoteProperty, 0);
|
| | | propertyDict.Add(promotePropertyId, 0);
|
| | | }
|
| | | var quality = GetReikiRootQuality(id, point);
|
| | | propertyDict[config.promoteProperty] += GetQualityProperty(id, quality);
|
| | | propertyDict[promotePropertyId] += GetQualityProperty(id, quality);
|
| | | }
|
| | |
|
| | | public int GetQualityProperty(int id, int quality)
|
| | | {
|
| | | var config = ReikiRootConfig.Get(id);
|
| | | var job = PlayerDatas.Instance.baseData.Job;
|
| | | var promoteValues = m_PromotePropertyValues[id][job];
|
| | | var value = 0;
|
| | | for (int i = 0; i < config.promoteValue.Length; i++)
|
| | | for (int i = 0; i < promoteValues.Length; i++)
|
| | | {
|
| | | if (quality > i)
|
| | | {
|
| | | value = config.promoteValue[i];
|
| | | value = promoteValues[i];
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | public int id;
|
| | | public int value;
|
| | | }
|
| | |
|
| | | public static class ReikiRootConfigUtil
|
| | | {
|
| | | public static int GetPromotePropertyId(this ReikiRootConfig config, int job)
|
| | | {
|
| | | if (config != null)
|
| | | {
|
| | | foreach (var item in config.promoteProperty)
|
| | | {
|
| | | if (item.x == job)
|
| | | {
|
| | | return item.y;
|
| | | }
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | | }
|
| | | } |
| | | |
| | | |
| | |
| | | {
|
| | | m_TreasurePotentials[i].StopUnlock();
|
| | | }
|
| | |
|
| | | foreach (var clock in clocks)
|
| | | {
|
| | | clock.Stop();
|
| | | Clock.Stop(clock);
|
| | | }
|
| | | clocks.Clear();
|
| | | }
|
| | |
| | | {
|
| | | m_TreasurePotentials[i].StopUnlock();
|
| | | }
|
| | |
|
| | | foreach (var clock in clocks)
|
| | | {
|
| | | clock.Stop();
|
| | | Clock.Stop(clock);
|
| | | }
|
| | | clocks.Clear();
|
| | |
|
| | | m_Controller.m_Scorller.RefreshActiveCellViews();
|
| | | DisplaySkillDetial();
|
| | | DisplayPotentials();
|
| | |
| | | {
|
| | | m_TreasurePotentials[index].StartUnlock();
|
| | | Clock clock = null;
|
| | | clock = Clock.Create(1, () =>
|
| | | clock = Clock.AlarmAfter(1, () =>
|
| | | {
|
| | | DisplayPotential(index);
|
| | | if (clock != null && clocks.Contains(clock))
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | if (m_MatchingClock != null && m_MatchingClock.isActiveAndEnabled)
|
| | | if (m_MatchingClock != null )
|
| | | {
|
| | | m_MatchingClock.Stop();
|
| | | Clock.Stop(m_MatchingClock);
|
| | | m_MatchingClock = null;
|
| | | }
|
| | |
|
| | | if (m_IsMatching)
|
| | | {
|
| | | matchingEndTime = DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond * GeneralDefine.teamMatchingTimeOut);
|
| | | m_MatchingClock = Clock.Create(matchingEndTime, OnMatchingCoolDownEnd);
|
| | | m_MatchingClock = Clock.AlarmAt(matchingEndTime, OnMatchingCoolDownEnd);
|
| | | }
|
| | |
|
| | | if (matchingStateChangeEvent != null)
|
| | |
| | | case JumpUIType.FindPreciousFrameFunc3:
|
| | | case JumpUIType.FindPreciousFrameFunc4:
|
| | | case JumpUIType.FindPreciousFrameFunc5:
|
| | | case JumpUIType.FindPreciousFrameFunc6:
|
| | | case JumpUIType.FindPreciousFrameFunc2Type2:
|
| | | case JumpUIType.FindPreciousFrameFunc4Type2:
|
| | | SetJumpLogic<FindPreciousFrameWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.LootPreciousFrameFunc1:
|
| | | case JumpUIType.DogzDungeon:
|
| | | case JumpUIType.FairyGrabBoss:
|
| | | case JumpUIType.JadeDynastyBoss290:
|
| | |
| | | FindPreciousFrameFunc3 = 84,
|
| | | FindPreciousFrameFunc4 = 85,
|
| | | FindPreciousFrameFunc5 = 86,
|
| | | FindPreciousFrameFunc6 = 104,//封魔坛
|
| | |
|
| | | MarketFunc1 = 87,
|
| | | MarketFunc2 = 88,
|
| | | MarketFunc3 = 89,
|
| | |
| | | RuneTower = 99,//符印塔
|
| | | WelfareFunc1 = 102, //签到
|
| | | WelfareFunc2 = 103, //祈愿
|
| | | LootPreciousFrameFunc1 = 104, //封魔坛
|
| | | DogzDungeon = 242, //异兽之地
|
| | | SystemSettingFunc1 = 109,//挂机设置
|
| | |
|
| | |
| | |
|
| | | public class WorldMapUnLockTip : MonoBehaviour
|
| | | {
|
| | | [SerializeField] Image m_LevelConditionSign;
|
| | | [SerializeField] Image m_TreasureConditionSign;
|
| | | [SerializeField] Text m_LevelCondtion;
|
| | | [SerializeField] Text m_TreasureCondition;
|
| | |
|
| | | TreasureModel treasureModel { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
|
| | | [SerializeField] Image m_ConditionSign1;
|
| | | [SerializeField] Image m_ConditionSign2;
|
| | | [SerializeField] Text m_Condtion1;
|
| | | [SerializeField] Text m_Condition2;
|
| | |
|
| | | public void Display(int _mapId)
|
| | | {
|
| | | var config = MapConfig.Get(_mapId);
|
| | | m_LevelCondtion.text = Language.Get("WorldMap_LV", config.LV);
|
| | | m_LevelCondtion.color = PlayerDatas.Instance.baseData.LV >= config.LV ? UIHelper.GetUIColor(TextColType.Green) : UIHelper.GetUIColor(TextColType.Red);
|
| | |
|
| | | if (string.IsNullOrEmpty(config.MapTaskText))
|
| | | if (config.realmLevel > 0)
|
| | | {
|
| | | m_TreasureConditionSign.gameObject.SetActive(false);
|
| | | m_TreasureCondition.text = "";
|
| | | var realmConfig = RealmConfig.Get(config.realmLevel);
|
| | | m_Condtion1.text = Language.Get("WorldMap_Realm", realmConfig.Name);
|
| | | m_Condtion1.color = UIHelper.GetUIColor(PlayerDatas.Instance.baseData.realmLevel >= config.realmLevel ? TextColType.Green : TextColType.Red);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_TreasureConditionSign.gameObject.SetActive(true);
|
| | | m_TreasureCondition.text = config.MapTaskText;
|
| | | m_Condtion1.text = Language.Get("WorldMap_LV", config.LV);
|
| | | m_Condtion1.color = UIHelper.GetUIColor(PlayerDatas.Instance.baseData.LV >= config.LV ? TextColType.Green : TextColType.Red);
|
| | | }
|
| | |
|
| | | if (string.IsNullOrEmpty(config.MapTaskText))
|
| | | {
|
| | | m_ConditionSign2.gameObject.SetActive(false);
|
| | | m_Condition2.text = "";
|
| | | }
|
| | | else
|
| | | {
|
| | | m_ConditionSign2.gameObject.SetActive(true);
|
| | | m_Condition2.text = config.MapTaskText;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | |
| | | public class FunctionButtonGroup : MonoBehaviour |
| | | { |
| | | [SerializeField] ScrollRect m_ScrollRect; |
| | | |
| | | public int unLockedCount { |
| | | get { |
| | | var count = 0; |
| | | foreach (var button in toggleButtons.Values) |
| | | foreach (var button in functionButtons.Values) |
| | | { |
| | | if (button.state != TitleBtnState.Locked) |
| | | { |
| | |
| | | |
| | | int currentOrder = 0; |
| | | List<int> orders = new List<int>(); |
| | | Dictionary<int, FunctionButton> toggleButtons = new Dictionary<int, FunctionButton>(); |
| | | Dictionary<int, FunctionButton> functionButtons = new Dictionary<int, FunctionButton>(); |
| | | |
| | | public void Register(FunctionButton _toggleButton) |
| | | public void Register(FunctionButton button) |
| | | { |
| | | toggleButtons[_toggleButton.order] = _toggleButton; |
| | | if (!orders.Contains(_toggleButton.order)) |
| | | functionButtons[button.order] = button; |
| | | if (!orders.Contains(button.order)) |
| | | { |
| | | orders.Add(_toggleButton.order); |
| | | orders.Add(button.order); |
| | | orders.Sort(OrderCompare); |
| | | } |
| | | } |
| | | |
| | | public void UnRegister(FunctionButton _toggleButton) |
| | | public void UnRegister(FunctionButton button) |
| | | { |
| | | if (toggleButtons.ContainsKey(_toggleButton.order)) |
| | | if (functionButtons.ContainsKey(button.order)) |
| | | { |
| | | toggleButtons.Remove(_toggleButton.order); |
| | | functionButtons.Remove(button.order); |
| | | } |
| | | |
| | | if (orders.Contains(_toggleButton.order)) |
| | | if (orders.Contains(button.order)) |
| | | { |
| | | orders.Remove(_toggleButton.order); |
| | | orders.Remove(button.order); |
| | | orders.Sort(OrderCompare); |
| | | } |
| | | |
| | | } |
| | | |
| | | public void NotifyToggleOn(FunctionButton _toggleButton) |
| | | public void NotifyToggleOn(FunctionButton button) |
| | | { |
| | | if (_toggleButton.state == TitleBtnState.Click) |
| | | if (button.state == TitleBtnState.Click) |
| | | { |
| | | currentOrder = _toggleButton.order; |
| | | currentOrder = button.order; |
| | | for (int i = 0; i < orders.Count; i++) |
| | | { |
| | | var toggleButton = toggleButtons[orders[i]]; |
| | | if (toggleButton != _toggleButton && toggleButton.state != TitleBtnState.Locked) |
| | | var functionButton = functionButtons[orders[i]]; |
| | | if (functionButton != button && functionButton.state != TitleBtnState.Locked) |
| | | { |
| | | toggleButton.state = TitleBtnState.Normal; |
| | | functionButton.state = TitleBtnState.Normal; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void TriggerByOrder(int _order) |
| | | public void TriggerByOrder(int targetOrder) |
| | | { |
| | | for (int i = 0; i < orders.Count; i++) |
| | | { |
| | | var order = orders[i]; |
| | | if (order == _order) |
| | | if (order == targetOrder) |
| | | { |
| | | toggleButtons[order].Invoke(true); |
| | | functionButtons[order].Invoke(true); |
| | | break; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | var next = orders[index]; |
| | | if (toggleButtons[next].state != TitleBtnState.Locked) |
| | | if (functionButtons[next].state != TitleBtnState.Locked) |
| | | { |
| | | toggleButtons[next].Invoke(false); |
| | | functionButtons[next].Invoke(false); |
| | | break; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | var next = orders[index]; |
| | | if (toggleButtons[next].state != TitleBtnState.Locked) |
| | | if (functionButtons[next].state != TitleBtnState.Locked) |
| | | { |
| | | toggleButtons[next].Invoke(false); |
| | | functionButtons[next].Invoke(false); |
| | | break; |
| | | } |
| | | } |
| | |
| | | return orders.Count > 0 && currentOrder == orders[orders.Count - 1]; |
| | | } |
| | | |
| | | public void GotoOrder(int order) |
| | | { |
| | | if (m_ScrollRect != null) |
| | | { |
| | | var index = orders.IndexOf(order); |
| | | if (m_ScrollRect.horizontal) |
| | | { |
| | | m_ScrollRect.horizontalNormalizedPosition = (float)index / orders.Count; |
| | | } |
| | | else |
| | | { |
| | | m_ScrollRect.verticalNormalizedPosition = (float)index / orders.Count; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private int OrderCompare(int a, int b) |
| | | { |
| | | return a < b ? -1 : 1; |
| | |
| | | using System; |
| | | using UnityEngine; |
| | | using System.Collections.Generic; |
| | | using UnityEngine.Events; |
| | | |
| | | public class Clock : MonoBehaviour |
| | | public class Clock |
| | | { |
| | | public bool stopped { get; private set; } |
| | | |
| | | public DateTime alarmTime { |
| | | get; set; |
| | | } |
| | | |
| | | DateTime alarmTime; |
| | | UnityAction alarmCallBack; |
| | | |
| | | public void AddListener(UnityAction _action) |
| | | public Clock(DateTime alarmTime, UnityAction callBack) |
| | | { |
| | | alarmCallBack += _action; |
| | | this.alarmTime = alarmTime; |
| | | this.alarmCallBack = callBack; |
| | | } |
| | | |
| | | public void Stop() |
| | | public bool CanAlarm() |
| | | { |
| | | stopped = true; |
| | | GameObject.Destroy(this.gameObject); |
| | | return DateTime.Now >= alarmTime; |
| | | } |
| | | |
| | | private void Awake() |
| | | public void Execute() |
| | | { |
| | | this.gameObject.hideFlags = HideFlags.HideInHierarchy; |
| | | } |
| | | |
| | | private void LateUpdate() |
| | | { |
| | | if (System.DateTime.Now > alarmTime) |
| | | if (alarmCallBack != null) |
| | | { |
| | | try |
| | | alarmCallBack(); |
| | | alarmCallBack = null; |
| | | } |
| | | } |
| | | |
| | | static List<Clock> clocks = new List<Clock>(); |
| | | |
| | | public static void Init() |
| | | { |
| | | new LogicUpdate().Start(OnUpdate); |
| | | } |
| | | |
| | | public static Clock AlarmAt(DateTime alarmTime, UnityAction callBack) |
| | | { |
| | | var clock = new Clock(alarmTime, callBack); |
| | | |
| | | clocks.Add(clock); |
| | | return clock; |
| | | } |
| | | |
| | | public static Clock AlarmAfter(int seconds, UnityAction callBack) |
| | | { |
| | | var clock = new Clock(DateTime.Now.AddSeconds(seconds), callBack); |
| | | |
| | | clocks.Add(clock); |
| | | return clock; |
| | | } |
| | | |
| | | public static void Stop(Clock clock) |
| | | { |
| | | if (clocks.Contains(clock)) |
| | | { |
| | | clocks.Remove(clock); |
| | | } |
| | | } |
| | | |
| | | static void OnUpdate() |
| | | { |
| | | for (var i = clocks.Count - 1; i >= 0; i--) |
| | | { |
| | | var clock = clocks[i]; |
| | | if (clock.CanAlarm()) |
| | | { |
| | | if (alarmCallBack != null) |
| | | try |
| | | { |
| | | alarmCallBack(); |
| | | alarmCallBack = null; |
| | | clock.Execute(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | Debug.LogException(e); |
| | | } |
| | | finally |
| | | { |
| | | clocks.RemoveAt(i); |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | DebugEx.Log(ex); |
| | | } |
| | | finally |
| | | { |
| | | Stop(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | public static Clock Create(DateTime _alarmTime, UnityAction _action) |
| | | { |
| | | var carrier = new GameObject(); |
| | | GameObject.DontDestroyOnLoad(carrier); |
| | | |
| | | var clock = carrier.AddComponent<Clock>(); |
| | | clock.alarmTime = _alarmTime; |
| | | clock.AddListener(_action); |
| | | |
| | | return clock; |
| | | } |
| | | |
| | | public static Clock Create(int _seconds, UnityAction _action) |
| | | { |
| | | var carrier = new GameObject(); |
| | | GameObject.DontDestroyOnLoad(carrier); |
| | | |
| | | var clock = carrier.AddComponent<Clock>(); |
| | | clock.alarmTime = System.DateTime.Now + new TimeSpan(_seconds * TimeSpan.TicksPerSecond); |
| | | clock.AddListener(_action); |
| | | |
| | | return clock; |
| | | } |
| | | |
| | | } |
| | |
| | | CDBPlayerRefresh_Water = 203,//# 灵根属性-水
|
| | | CDBPlayerRefresh_Fire = 204,//# 灵根属性-火
|
| | | CDBPlayerRefresh_Earth = 205,//# 灵根属性-土
|
| | | CDBPlayerRefresh_NormalHurt = 206,// # 属性普通攻击增伤:普通攻击附加的固定值伤害 |
| | | CDBPlayerRefresh_NormalHurtPer = 207,// # 属性普通攻击增伤:普通攻击附加的固定值伤害 |
| | | CDBPlayerRefresh_FabaoHurt = 208,// # 属性普通攻击增伤:普通攻击附加的固定值伤害 |
| | | CDBPlayerRefresh_FabaoHurtPer = 209,// # 属性普通攻击增伤:普通攻击附加的固定值伤害 |
| | |
|
| | | };
|
| | |
|
| | | /** 背包类型码定义 */
|