public List <Goods_goods.GoodShowData> GetEquipShowAttrs(LocalSave.EquipOne one) { List <Goods_goods.GoodShowData> list = new List <Goods_goods.GoodShowData>(); int level = one.Level; Equip_equip beanById = base.GetBeanById(one.EquipID); int index = 0; int length = beanById.Attributes.Length; while (index < length) { Goods_goods.GoodData goodData = Goods_goods.GetGoodData(beanById.Attributes[index]); level = MathDxx.Clamp(level, 0, one.CurrentMaxLevel); if (goodData.percent) { goodData.value += ((level - 1) * beanById.AttributesUp[index]) * 100; } else { goodData.value += (level - 1) * beanById.AttributesUp[index]; } goodData.value = (long)(goodData.value * (1f + GameLogic.SelfAttributeShow.GetUpPercent(one.Position))); Goods_goods.GoodShowData goodShowData = Goods_goods.GetGoodShowData(goodData); if (one.IsBaby && !goodData.goodType.Contains("EquipBaby:")) { string languageByTID = GameLogic.Hold.Language.GetLanguageByTID("Attr_BabyParentContent", Array.Empty <object>()); object[] args = new object[] { languageByTID, goodShowData.goodType }; goodShowData.goodType = Utils.FormatString("{0}{1}", args); } list.Add(goodShowData); index++; } return(list); }
private void Update() { this.time += Time.deltaTime; if (this.state == 0) { float num = MathDxx.Clamp(this.time, 0f, 0.3f) / 0.3f; this.child.transform.localScale = Vector3.one * num; if (this.time > this.downtime) { this.state = 1; } } else if (this.state == 1) { if (this.time > this.alltime) { this.time = this.alltime; } float num2 = (this.time - this.downtime) / (this.alltime - this.downtime); this.child.transform.localPosition = new Vector3(0f, 0f, 15f * (1f - num2)); if (this.time >= this.alltime) { this.child.SetActive(false); } } }
private void InitUI() { string str = string.Empty; DateTime time = new DateTime(this.mTransfer.assertendtime); DateTime now = DateTime.Now; TimeSpan span = (TimeSpan)(time - now); if (span.Days >= 1) { object[] objArray1 = new object[] { span.Days }; str = GameLogic.Hold.Language.GetLanguageByTID("time_day", objArray1); } else if (span.Hours >= 1) { object[] objArray2 = new object[] { span.Hours }; str = GameLogic.Hold.Language.GetLanguageByTID("time_hour", objArray2); } else { int num = MathDxx.Clamp(span.Minutes, 10, span.Minutes); object[] objArray3 = new object[] { num }; str = GameLogic.Hold.Language.GetLanguageByTID("time_hour", objArray3); } object[] args = new object[] { str }; string languageByTID = GameLogic.Hold.Language.GetLanguageByTID("serverassert_content", args); this.Text_Content.text = languageByTID; }
private void OnUpdate() { if ((Time.time - this.checkTime) > 3f) { this.checkTime = Time.time; this.iter = this.mBulletList.GetEnumerator(); while (this.iter.MoveNext()) { this.iterkey = this.iter.Current.Key; if (!this.mBulletCounts.TryGetValue(this.iterkey, out this.stCountTemp)) { this.stCountTemp = this.stCount; } this.itertime = this.GetLastUseTime(this.iterkey); this.iterq = this.iter.Current.Value; if ((this.iterq != null) && ((Time.time - this.itertime) > 180f)) { this.RemoveMoreBullets(this.iterq, this.stCountTemp); if ((Time.time - this.itertime) > 540f) { this.itertimecount = (int)(((Time.time - this.itertime) - 540f) / 180f); this.itertimecount = this.stCountTemp - this.itertimecount; this.itertimecount = MathDxx.Clamp(this.itertimecount, 0, this.itertimecount); this.RemoveMoreBullets(this.iterq, this.itertimecount); } } } } }
private void OnUpdate() { if ((Time.time - this.checkTime) > 3.1f) { this.checkTime = Time.time; this.iter = this.mEffectList.GetEnumerator(); while (this.iter.MoveNext()) { this.iterkey = this.iter.Current.Key; this.itertime = this.GetLastUseTime(this.iterkey); if (!this.mEffectCounts.TryGetValue(this.iterkey, out this.stCountTemp)) { this.stCountTemp = this.stCount; } if (this.mEffectList.TryGetValue(this.iterkey, out this.iterq) && ((Time.time - this.itertime) > 190f)) { this.RemoveMoreEffects(this.iterq, this.stCountTemp); if ((Time.time - this.itertime) > 200f) { this.itertimecount = (int)((((Time.time - this.itertime) - 190f) - 10f) / 10f); this.itertimecount = this.stCountTemp - this.itertimecount; this.itertimecount = MathDxx.Clamp(this.itertimecount, 0, this.itertimecount); this.RemoveMoreEffects(this.iterq, this.itertimecount); } } } } }
private void InitUI() { this.Text_ID.text = this.mTransfer.id; int num = 0x3e8; string receipt = this.mTransfer.receipt; int num2 = (this.mTransfer.receipt.Length / num) + 1; float y = 0f; for (int i = 0; i < num2; i++) { int startIndex = i * num; int num6 = (i + 1) * num; num6 = MathDxx.Clamp(num6, 0, this.mTransfer.receipt.Length); if (num6 < startIndex) { startIndex = num6; } string str2 = "empty"; if (startIndex < num6) { str2 = receipt.Substring(startIndex, num6 - startIndex); } Text text = this.mPool.DeQueue <Text>(); text.transform.SetParentNormal(this.mScrollRect.get_content()); text.text = str2; (text.transform as RectTransform).anchoredPosition = new Vector2(0f, -y); y += text.preferredHeight; if (startIndex == num6) { break; } } this.mScrollRect.get_content().sizeDelta = new Vector2(this.mScrollRect.get_content().sizeDelta.x, y); this.Text_Title.text = "读取消息流失败"; }
private void UpdateMoveSpeed() { float num = (this.movetime * this.addspeed) + 1f; num = MathDxx.Clamp(num, num, this.maxspeed); this.m_MoveData._moveDirection = this.m_MoveData._moveDirection.normalized * num; }
private void onClickButtonInternal(int count) { bool flag = false; bool flag2 = false; if (LocalSave.Instance.GetDiamondBoxFreeCount(base.mBoxType) > 0) { flag = true; flag2 = true; } else { count = MathDxx.Clamp(count, 0, base.mTransfer.diamonds.Length - 1); if (base.CheckCanOpen(2, this.get_price(count))) { flag2 = true; } } if (flag2) { if (LocalSave.Instance.GetTimeBoxCount(LocalSave.TimeBoxType.BoxChoose_DiamondNormal) > 0) { SdkManager.send_event_ad(ADSource.eDiamondNormal, "CLICK", 0, 0, string.Empty, string.Empty); } if (!NetManager.IsNetConnect) { CInstance <TipsUIManager> .Instance.Show(ETips.Tips_NetError, Array.Empty <string>()); if (LocalSave.Instance.GetTimeBoxCount(LocalSave.TimeBoxType.BoxChoose_DiamondNormal) > 0) { SdkManager.send_event_ad(ADSource.eDiamondNormal, "IMPRESSION", 0, 0, "FAIL", "NET_ERROR"); } } else if (LocalSave.Instance.GetTimeBoxCount(LocalSave.TimeBoxType.BoxChoose_DiamondNormal) > 0) { if (LocalSave.Instance.IsAdFree()) { this.send_get_box(); } else if (!AdsRequestHelper.getRewardedAdapter().isLoaded()) { SdkManager.send_event_ad(ADSource.eDiamondNormal, "IMPRESSION", 0, 0, "FAIL", "AD_NOT_READY"); WindowUI.ShowAdInsideUI(AdInsideProxy.EnterSource.eGameTurn, delegate { SdkManager.send_event_ad(ADSource.eDiamondNormal, "REWARD", 0, 0, "INSIDE", string.Empty); this.send_get_box(); }); } else { AdsRequestHelper.getRewardedAdapter().Show(this); SdkManager.send_event_ad(ADSource.eDiamondNormal, "IMPRESSION", 0, 0, "SUCCESS", string.Empty); } } else { this.send_get_box(); } } }
private bool Goto(string name, bool play = false) { if (this.mList.TryGetValue(name, out ShopOneBase base2)) { this.gotopos = -base2.mRectTransform.anchoredPosition.y + this.uppos; this.gotopos = MathDxx.Clamp(this.gotopos, 0f, this.maxcontenty); this.mScrollRect.Goto(this.gotopos, play); return(true); } return(false); }
private void UpdateValue() { if (this._max > 0) { base.Value = ((float)MathDxx.Clamp(this._cur, 0, this._cur)) / ((float)this._max); if (this.text != null) { object[] args = new object[] { this._cur, this._max }; this.text.text = Utils.FormatString("{0}/{1}", args); } } }
private void OnUpdate(float delta) { this.time += delta; this.time = MathDxx.Clamp(this.time, 0f, this.alltime); int num = 0; int count = this.list.Count; while (num < count) { this.list[num].SetLine(true, this.mindiss[num] * (this.time / this.alltime)); num++; } }
private void Awake() { Application.targetFrameRate = 60; Screen.sleepTimeout = -1; GameLogic.Width = 720; GameLogic.Height = (int)((Screen.height * GameLogic.Width) / ((float)Screen.width)); GameLogic.WidthScale = ((float)GameLogic.Width) / ((float)GameLogic.DesignWidth); GameLogic.HeightScale = ((float)GameLogic.Height) / ((float)GameLogic.DesignHeight); GameLogic.ScreenSize = new Vector2(((float)(Screen.width * GameLogic.DesignHeight)) / ((float)Screen.height), (float)GameLogic.DesignHeight); GameLogic.WidthScaleAll = (GameLogic.WidthScale >= GameLogic.HeightScale) ? 1f : (GameLogic.WidthScale / GameLogic.HeightScale); float num = (((float)GameLogic.Width) / ((float)GameLogic.Height)) * GameLogic.DesignHeight; GameLogic.WidthReal = MathDxx.Clamp(num, num, (float)GameLogic.DesignWidth); GameLogic.ResetMaxResolution(); }
public Sequence PlayCount(int after, float alltime) { int num = MathDxx.Abs((int)(after - this.current)); float num2 = alltime; if (num != 0) { num2 = alltime / ((float)num); } num2 = MathDxx.Clamp(num2, 0f, 0.15f); this.PlayTextScale(1.4f, 0.15f); TweenSettingsExtensions.SetUpdate <Tweener>(DOTween.To(new DOGetter <int>(this, this.get_current), new DOSetter <int>(this, this.< PlayCount > m__0), after, num2 * num), true); Sequence sequence = DOTween.Sequence(); TweenSettingsExtensions.SetUpdate <Sequence>(TweenSettingsExtensions.AppendInterval(TweenSettingsExtensions.AppendCallback(TweenSettingsExtensions.AppendInterval(sequence, num2 * (num - 1)), new TweenCallback(this, this.< PlayCount > m__1)), num2), true); return(sequence); }
private void UpdateLineWidth() { if (this.line != null) { if (!this.bNearEnd && (this.starttime < (this.line_update_time + 0.1f))) { this.starttime += Updater.delta; this.starttime = MathDxx.Clamp(this.starttime, 0f, this.line_update_time); this.line.widthMultiplier = (this.starttime / this.line_update_time) * this.startwidth; } if (this.bNearEnd) { this.starttime += Updater.delta; this.starttime = MathDxx.Clamp(this.starttime, 0f, this.line_update_time); this.line.widthMultiplier = (1f - (this.starttime / this.line_update_time)) * this.startwidth; } } }
private void InitUI() { IList <Shop_ReadyShop> allBeans = LocalModelManager.Instance.Shop_ReadyShop.GetAllBeans(); int count = allBeans.Count; count = MathDxx.Clamp(count, count, 2); this.goodbuy = LocalSave.Instance.BattleIn_GetFirstShop(); for (int i = 0; i < count; i++) { FirstItemOnectrl onectrl = this.mPool.DeQueue <FirstItemOnectrl>(); onectrl.Init(i, allBeans[i], GameLogic.Hold.BattleData.GetFirstShopBuy(i)); onectrl.OnClickButton = new Action <FirstItemOnectrl>(this.OnClickBuy); onectrl.SetBuy(this.goodbuy[i]); RectTransform child = onectrl.transform as RectTransform; child.SetParentNormal(this.itemsparent); child.anchoredPosition = new Vector2(0f, (float)(i * -170)); } }
private void InitUI() { GameLogic.Hold.Guide.mCard.GoNext(1, this.Button_Upgrade.transform as RectTransform); this.OnClickBG(); this.bInitOver = false; this.ResetRandom(); this.randomcard = null; this.randomobj.gameObject.SetActive(false); this.mCardList.Clear(); this.UpdateButton(); this.mPool.Collect <CardOneCtrl>(); this.cards = LocalSave.Instance.GetCardsList(); this.cards.Sort(new Comparison <LocalSave.CardOne>(this.Sort)); int num = MathDxx.Clamp(this.cards.Count, 0, 0x10); TweenExtensions.Kill(this.s, false); this.s = DOTween.Sequence(); for (int i = 0; i < num; i++) {
private void GetRandomEquip(ref List <BattleDropData> list, Soldier_soldier data) { if (this.equip_talent_enable) { int num = (int)(((data.EquipRate * this.mDropData.EquipProb) * 100f) * (1f + GameLogic.Self.m_EntityData.attribute.EquipDrop.Value)); if (this.equip_must_drop) { if (data.CharID > 0x1388) { List <BattleDropData> dropList = this.GetDropList(); int num2 = 0; int count = dropList.Count; while (num2 < count) { if ((dropList[num2].type == FoodType.eEquip) && (dropList[num2].data != null)) { LocalSave.EquipOne one = dropList[num2].data as LocalSave.EquipOne; if ((one != null) && (one.data.Position != 1)) { list.Add(dropList[num2]); this.equip_must_drop = false; return; } } num2++; } this.GetRandomEquip(ref list, data); } } else { this.level_dropequip += num; this.level_dropequip = MathDxx.Clamp(this.level_dropequip, 0L, (long)(1E+08f * GameConfig.GetEquipDropMaxRate())); if (GameLogic.Random(0, 0x5f5e100) < this.level_dropequip) { this.level_dropequip = 0L; List <BattleDropData> dropList = this.GetDropList(); list.AddRange(dropList); } LocalSave.Instance.SaveExtra.SetEquipDropRate(this.level_dropequip); } } }
public string GetBeat(int layer) { IList <Beat_beat> allBeans = base.GetAllBeans(); int count = base.GetBeanKeyList().Count; Beat_beat _beat = this.GetBeatOne((long)layer, 0, count - 1); if (_beat == null) { return(MathDxx.Clamp((float)layer, 0f, 100f) + "%"); } if (_beat.ID == 0) { return("0.1%"); } Beat_beat beanById = base.GetBeanById(_beat.ID - 1); float num2 = ((float)(layer - beanById.Score)) / ((float)(_beat.Score - beanById.Score)); float num3 = ((_beat.Rate - beanById.Rate) * num2) + beanById.Rate; return(Utils.GetFloat2(num3 * 100f) + "%"); }
private void onClickButtonInternal(int count) { bool flag = false; if (LocalSave.Instance.GetDiamondBoxFreeCount(base.mBoxType) > 0) { flag = true; } else { count = MathDxx.Clamp(count, 0, base.mTransfer.diamonds.Length - 1); if (base.CheckCanOpen(2, this.get_price(count))) { flag = true; } } if (flag) { this.send_get_box(); } }
private void SetBoxX(float x) { x = MathDxx.Clamp(x, x, this.maxWidth); if (base.boxList.Length > 0) { base.boxList[0].size = new Vector3(x + 0.4f, base.boxList[0].size.y, base.boxList[0].size.z); } if (this.line != null) { this.line.localScale = new Vector3(this.line.localScale.x, x / 2f, this.line.localScale.z); } if (this.ball_left != null) { this.ball_left.localPosition = new Vector3(-x / 2f, 0f, 0f); this.ball_left.rotation = Quaternion.Euler(-35f, 0f, 0f); } if (this.ball_right != null) { this.ball_right.localPosition = new Vector3(x / 2f, 0f, 0f); this.ball_right.rotation = Quaternion.Euler(-35f, 0f, 0f); } }
private void InitUI() { this.uppos = -70f + PlatformHelper.GetFringeHeight(); float uppos = this.uppos; float y = -uppos; int num3 = 0; int count = this.openlist.Count; while (num3 < count) { Func <bool> func = null; if ((this.mOpenCondition.TryGetValue(this.openlist[num3], out func) && (func != null)) && !func()) { ShopOneBase base2 = this.get_one(this.openlist[num3]); if (base2 != null) { base2.gameObject.SetActive(false); } } else { ShopOneBase shop = this.GetShop(this.openlist[num3]); shop.gameObject.SetActive(true); shop.Init(); shop.mRectTransform.anchoredPosition = new Vector3(0f, uppos, 0f); uppos -= shop.mRectTransform.sizeDelta.y; y += shop.mRectTransform.sizeDelta.y; } num3++; } this.UpdateNet(); y += 200f; this.mScrollRect.get_content().sizeDelta = new Vector2(this.mScrollRect.get_content().sizeDelta.x, y); this.maxcontenty = y - this.windowt.sizeDelta.y; this.maxcontenty = MathDxx.Clamp(this.maxcontenty, 0f, this.maxcontenty); this.Goto(0, false); }
private void InitUI() { this.buys.Clear(); this.shoptype = LocalModelManager.Instance.Shop_MysticShop.GetRandomShopType(); this.mDataList = LocalModelManager.Instance.Shop_MysticShop.GetListByStage(GameLogic.Hold.BattleData.Level_CurrentStage, this.shoptype); this.mList.Clear(); int count = this.mDataList.Count; float num3 = (-(MathDxx.Clamp(count, 0, 4) - 1) * 200f) / 2f; for (int i = 0; i < count; i++) { BlackItemOnectrl item = this.mPool.DeQueue <BlackItemOnectrl>(); item.Init(i, this.mDataList[i]); item.OnClickButton = new Action <BlackItemOnectrl>(this.OnClickBuy); RectTransform child = item.transform as RectTransform; child.SetParentNormal(this.items); child.anchoredPosition = new Vector2(num3 + ((i % 4) * 200f), 120f + ((i / 4) * -240f)); this.mList.Add(item); } this.shows.Clear(); int num5 = 0; int num6 = this.mDataList.Count; while (num5 < num6) { this.shows.Add(this.mDataList[num5].ProductId); num5++; } for (int j = this.shows.Count; j < 8; j++) { this.shows.Add(0); } if (this.shows.Count >= 8) { SdkManager.send_event_mysteries("SHOW", this.shoptype, 0, 0, this.shows[0], this.shows[1], this.shows[2], this.shows[3], this.shows[4], this.shows[5], this.shows[6], this.shows[7], 0, 0, string.Empty, string.Empty); } }
private ActionBasic.ActionBase GetCall2() { AIBase.ActionSequence sequence = new AIBase.ActionSequence { ConditionBase1Data = this.callid, ConditionBase1 = new Func <object, bool>(this.GetCanCall) }; sequence.AddAction(base.GetActionDelegate(delegate { base.m_Entity.m_AniCtrl.SendEvent("Call", false); })); sequence.AddAction(base.GetActionWait(string.Empty, 600)); sequence.AddAction(base.GetActionDelegate(delegate { int aliveCount = base.GetAliveCount(this.callid, false); int num2 = this.maxcount - aliveCount; num2 = MathDxx.Clamp(num2, 0, this.list.Count); this.list.RandomSort <Vector3>(); for (int i = 0; i < num2; i++) { base.CallOneInternal(this.callid, this.list[i], true); base.AddCallCount(this.callid); } })); sequence.AddAction(base.GetActionWait("actionwait", 0x4b0)); return(sequence); }
private void OnUpdate(float delta) { this.time += delta; this.time = MathDxx.Clamp(this.time, 0f, this.alltime); this.ctrl.SetLine(true, this.mindis * (this.time / this.alltime)); }