public void OnUpdate(object obj) { LTSpeedSnatchILRModel.GetInstance().listRewardShowItemData.Clear(); ArrayList al = obj as ArrayList; for (var k = 0; k < al.Count; k++) { var v = al[k]; Hashtable has = v as Hashtable; if (has.ContainsKey("TagAttrRedeemItem")) { ArrayList items = has["TagAttrRedeemItem"] as ArrayList; if (items.Count > 0) { for (int i = 0; i < items.Count; i++) { Hashtable ih = items[i] as Hashtable; string type = EB.Dot.String("type", ih, string.Empty); string id = EB.Dot.String("data", ih, string.Empty); int count = EB.Dot.Integer("quantity", ih, 0); LTShowItemData data = new LTShowItemData(id, count, type); LTSpeedSnatchILRModel.GetInstance().listRewardShowItemData.Add(data); } } } } }
void OnNewNpc() { if (!LTSpeedSnatchILRModel.GetInstance().IsActive) { LTSpeedSnatchILRModel.GetInstance().IsActive = true; } }
public void OnUpdate(object obj) { isMainlandGhostTime = EB.Dot.Bool("isMainlandGhostTime", obj, false); string str = EB.Dot.String("MainlandGhostTag", obj, string.Empty); if (str.Equals(string.Empty)) { currentTagAttr = null; } else { currentTagAttr = new int[str.Length]; for (int i = 0; i < currentTagAttr.Length; i++) { currentTagAttr[i] = int.Parse(str[i].ToString()); } } //Debug.LogError("SpeedSnatch TagAttr Change!"); LTSpeedSnatchILRModel.GetInstance().IsReset = false; LTSpeedSnatchILRModel.GetInstance().IsActive = isMainlandGhostTime; LTSpeedSnatchILRModel.GetInstance().CurrentTagAttr = currentTagAttr; if (!LTSpeedSnatchILRModel.GetInstance().hasRequire) { LTSpeedSnatchILRModel.GetInstance().hasRequire = true; } }
void OnLeaveNpc() { if (LTSpeedSnatchILRModel.GetInstance().IsActive) { LTSpeedSnatchILRModel.GetInstance().IsActive = false; } }
public override void Initialize(Config config) { LTSpeedSnatchILRModel.GetInstance().CurrentTagAttr = null; Hotfix_LT.Messenger.AddListener("LTSpeedSnatchEvent.IdleFollow", OnIdleFollow); Hotfix_LT.Messenger.AddListener <string, string>("LTSpeedSnatchEvent.TouchEnemy", OnTouchEnemy); Hotfix_LT.Messenger.AddListener("GetSpeedSnatchBaseData", GetSpeedSnatchBase); }
void OnOpenAward() { if (LTSpeedSnatchILRModel.GetInstance().listRewardShowItemData.Count > 0) { GlobalMenuManager.Instance.Open("LTShowRewardView", LTSpeedSnatchILRModel.GetInstance().listRewardShowItemData); } }
public static LTSpeedSnatchILRModel GetInstance() { if (_instance == null) { _instance = new LTSpeedSnatchILRModel(); } return(_instance); }
public override void Disconnect(bool isLogout) { if (_activeMonitor != null) { EB.Coroutines.Stop(_activeMonitor); } LTSpeedSnatchILRModel.GetInstance().isActiviyMonitor = false; }
private int challengeTimes = 6;//总挑战次数 public override void OnLoggedIn() { Hotfix_LT.Data.SpecialActivityTemplate temp = Hotfix_LT.Data.EventTemplateManager.Instance.GetSpecialActivity(activityId); if (temp != null) { challengeTimes = temp.times; } LTSpeedSnatchILRModel.GetInstance().hasRequire = false; }
void OnSpeedSnatchBase(int[] attr) { if (attr == null) { for (int i = 0; i < _items.Length; i++) { _items[i].attributeIcon.gameObject.SetActive(false); SetFxObjAction(_items[i]); _items[i].wenSpt.gameObject.SetActive(true); } _progress.value = 0; if (_progressChange != null) { EB.Coroutines.Stop(_progressChange); } } else { if (_progressChange != null) { EB.Coroutines.Stop(_progressChange); } for (int i = 0; i < _items.Length; i++) { if (i >= attr.Length) { _items[i].wenSpt.gameObject.SetActive(true); _items[i].attributeIcon.gameObject.SetActive(false); SetFxObjAction(_items[i]); } else { _items[i].attributeIcon.spriteName = LTPartnerConfig.LEVEL_SPRITE_NAME_DIC[(Hotfix_LT.Data.eRoleAttr)attr[i]]; SetFxObjAction(_items[i], (Hotfix_LT.Data.eRoleAttr)attr[i]); _items[i].wenSpt.gameObject.SetActive(false); _items[i].attributeIcon.gameObject.SetActive(true); } } if (LTSpeedSnatchILRModel.GetInstance().firstEnterMainLand) { LTSpeedSnatchILRModel.GetInstance().firstEnterMainLand = false; LTSpeedSnatchILRModel.GetInstance().AttrLength = attr.Length; } if (LTSpeedSnatchILRModel.GetInstance().AttrLength != attr.Length) { _progressChange = EB.Coroutines.Run(ProgressChange(((float)attr.Length) / 3, (Hotfix_LT.Data.eRoleAttr)attr[attr.Length - 1])); LTSpeedSnatchILRModel.GetInstance().AttrLength = attr.Length; } else { _progress.value = attr.Length * 0.33f; } } }
IEnumerator ActivityMonitor() { while (LTSpeedSnatchILRModel.GetInstance().isActiviyMonitor) { if (SceneLogicManager.isMainlands()) { ActivityMonitorFunc(); } yield return(LTSpeedSnatchILRModel.GetInstance().monitorWFS); } }
void OnTouchEnemy(string ghostId, string sceneName) { int curTimes = 0; DataLookupsCache.Instance.SearchIntByID(string.Format("special_activity.{0}.c_times", activityId), out curTimes); if (!LTSpeedSnatchILRModel.GetInstance().IsReset&& curTimes >= challengeTimes) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_SPEED_SNATCH_TIMESOVER")); return; } PostSpeedSnatchAttackEnemy(ghostId, sceneName); }
void OnIdleFollow() { if (LTSpeedSnatchILRModel.GetInstance().hasRequire) { return; } if (MainLandLogic.GetInstance().SceneId == 0) { return; } LTSpeedSnatchILRModel.GetInstance().firstEnterMainLand = true; GetSpeedSnatchBase(); }
public override void Connect() { LTSpeedSnatchILRModel.GetInstance(); GameDataSparxManager.Instance.Register <LTSpeedSnatchBaseNodeData>("special_activity.mainland_ghost"); GameDataSparxManager.Instance.Register <LTSpeedSnatchRewardData>("combat.rewards"); GameDataSparxManager.Instance.Register <LTSpeedSnatchNpcData>("mainlands.npc_list"); Dictionary <string, MainlandsGhostRewardTemplate> gRewards = Hotfix_LT.Data.SceneTemplateManager.Instance.GetAllMainlandsGhostReward(); LTSpeedSnatchILRModel.GetInstance().ListGhostReward.Clear(); GhostReward but = null; foreach (var v in gRewards) { if (v.Value.type.Equals("111") || v.Value.type.Equals("222") || v.Value.type.Equals("333") || v.Value.type.Equals("123")) { GhostReward reward = new GhostReward(); reward.attrs = new int[v.Value.type.Length]; reward.spriteNames = new string[reward.attrs.Length]; for (int i = 0; i < reward.attrs.Length; i++) { reward.attrs[i] = int.Parse(v.Value.type[i].ToString()); reward.spriteNames[i] = LTPartnerConfig.LEVEL_SPRITE_NAME_DIC[(Hotfix_LT.Data.eRoleAttr)reward.attrs[i]]; } reward.rewards = v.Value.reward; LTSpeedSnatchILRModel.GetInstance().ListGhostReward.Add(reward); } else if (but == null && v.Value.type.Equals("112")) //认为112和其他组都是一样的道具 { but = new GhostReward(); but.attrs = new int[v.Value.type.Length]; but.spriteNames = new string[but.attrs.Length]; for (int i = 0; i < but.attrs.Length; i++) { but.attrs[i] = int.Parse(v.Value.type[i].ToString()); but.spriteNames[i] = LTPartnerConfig.LEVEL_SPRITE_NAME_DIC[(Hotfix_LT.Data.eRoleAttr)but.attrs[i]]; } but.rewards = v.Value.reward; LTSpeedSnatchILRModel.GetInstance().ListGhostReward.Add(but); } } LTSpeedSnatchILRModel.GetInstance().OpenTime = Hotfix_LT.Data.EventTemplateManager.Instance.GetActivityTimeByCronJobsName("main_land_ghost_start"); LTSpeedSnatchILRModel.GetInstance().EndTime = Hotfix_LT.Data.EventTemplateManager.Instance.GetActivityTimeByCronJobsName("main_land_ghost_stop"); LTSpeedSnatchILRModel.GetInstance().isActiviyMonitor = true; _activeMonitor = EB.Coroutines.Run(ActivityMonitor()); }
public void OnUpdate(object obj) { bool isFind = false; Hashtable hs = obj as Hashtable; string key = "role"; string use = "ghost"; foreach (var v in hs.Values) { string role = EB.Dot.String(key, v, string.Empty); if (role.Equals(use)) { isFind = true; break; } } LTSpeedSnatchILRModel.GetInstance().isNpcGhostFind = isFind; }
private void ActivityMonitorFunc() { if (!Hotfix_LT.Data.EventTemplateManager.Instance.GetRealmIsOpen("main_land_ghost_start")) { if (LTSpeedSnatchILRModel.GetInstance().IsActive) { LTSpeedSnatchILRModel.GetInstance().IsActive = false; } } else if (Hotfix_LT.Data.EventTemplateManager.Instance.IsTimeOKEX(LTSpeedSnatchILRModel.GetInstance().OpenTime, LTSpeedSnatchILRModel.GetInstance().EndTime)) //Hotfix_LT.Data.EventTemplateManager.Instance.IsTimeOK("main_land_ghost_start", "main_land_ghost_stop")) { if (AutoRefreshingManager.Instance.GetRefreshed(AutoRefreshingManager.RefreshName.SpecialActivity)) { LTSpeedSnatchILRModel.GetInstance().IsReset = true; LTSpeedSnatchILRModel.GetInstance().CurrentTagAttr = null; } //在本地活动时间,进行挑战次数判断 int curTimes = 0; DataLookupsCache.Instance.SearchIntByID(string.Format("special_activity.{0}.c_times", activityId), out curTimes); if (!LTSpeedSnatchILRModel.GetInstance().IsReset&& !(LTSpeedSnatchILRModel.GetInstance().CurrentTagAttr != null && LTSpeedSnatchILRModel.GetInstance().CurrentTagAttr.Length == 3) && curTimes >= challengeTimes) { //Debug.Log("SpeedSnatch times is over!"); if (LTSpeedSnatchILRModel.GetInstance().IsActive) { LTSpeedSnatchILRModel.GetInstance().IsActive = false; } } else if (!LTSpeedSnatchILRModel.GetInstance().IsActive) { LTSpeedSnatchILRModel.GetInstance().IsActive = true; } } else if (LTSpeedSnatchILRModel.GetInstance().IsActive&& !LTSpeedSnatchILRModel.GetInstance().isNpcGhostFind) { //本地活动时间截止 且 怪物移除 if (LTSpeedSnatchILRModel.GetInstance().IsActive) { LTSpeedSnatchILRModel.GetInstance().IsActive = false; } } }
public override void Awake() { base.Awake(); if (!LTSpeedSnatchILRModel.GetInstance().IsActive) { mDMono.gameObject.CustomSetActive(false); } _items = new LTSpeedSnatchActiveItem[3]; Transform itemTran = mDMono.transform.Find("Container/SnatchActiveItem1"); _items[0] = new LTSpeedSnatchActiveItem(itemTran, mDMono.GetComponent <UIPanel>()); itemTran = mDMono.transform.Find("Container/SnatchActiveItem2"); _items[1] = new LTSpeedSnatchActiveItem(itemTran, mDMono.GetComponent <UIPanel>()); itemTran = mDMono.transform.Find("Container/SnatchActiveItem3"); _items[2] = new LTSpeedSnatchActiveItem(itemTran, mDMono.GetComponent <UIPanel>()); _bxBtn = mDMono.transform.Find("Container/BxButton").GetComponent <UIButton>(); _infoBtn = mDMono.transform.Find("Container/InfoButton").GetComponent <UIButton>(); _progress = mDMono.transform.Find("Container/SnatchProgress").GetComponent <UIProgressBar>(); _boxFx = _bxBtn.GetComponent <ParticleSystemUIComponent>(); if (_boxFx != null) { _boxFx.panel = mDMono.GetComponent <UIPanel>(); } _bxBtn.onClick.Add(new EventDelegate(OnClickBx)); _infoBtn.onClick.Add(new EventDelegate(OnClickInfo)); LTSpeedSnatchHotfixEvent.SpeedSnatchBase += OnSpeedSnatchBase; LTSpeedSnatchHotfixEvent.SpeedSnatchActive += OnSpeedSnatchActive; Hotfix_LT.Messenger.AddListener("LTSpeedSnatchEvent.DropFunc", OnDropFunc); }
void OnClickBx() { GlobalMenuManager.Instance.Open("LTSpeedSnatchAwardInfoHudUI", LTSpeedSnatchILRModel.GetInstance().ListGhostReward); }