public void Init(EntityBase entity, HitStruct hs) { this.mHitType = hs.type; this.curve_pos = GameLogic.GetHPChangerAnimation(this.mHitType, 0); this.curve_scale = GameLogic.GetHPChangerAnimation(this.mHitType, 1); this.curve_alpha = GameLogic.GetHPChangerAnimation(this.mHitType, 2); this.starttime = Updater.AliveTime; this.OffsetX = GameLogic.Random((float)-50f, (float)50f); this.OffsetY = GameLogic.Random((float)0f, (float)30f); this.MovePer.x = this.OffsetX / 14f; this.MovePer.y = this.OffsetY / 14f; this.CurrentMoveCount = 14; this.MoveAll = Vector3.zero; this.m_Entity = entity; this.entitypos = entity.position; this.entitybodypos = entity.m_Body.HPMask.transform.localPosition; if (hs.element != EElementType.eNone) { this.text.set_color(EntityData.ElementData[hs.element].color); this.text.text = hs.real_hit.ToString(); } else { switch (this.mHitType) { case HitType.Crit: { object[] args = new object[] { hs.real_hit }; this.text.text = Utils.FormatString("{0}!", args); this.text.set_color(Color.red); this.text.fontSize = (int)(this.FontSize * this.CritFontScale); return; } case HitType.HeadShot: this.text.text = GameLogic.Hold.Language.GetLanguageByTID("爆头", Array.Empty <object>()); this.text.set_color(Color.red); this.text.fontSize = (int)(this.FontSize * this.HeadShotFontScale); return; case HitType.Add: { object[] args = new object[] { hs.real_hit }; this.text.text = Utils.FormatString("+{0}", args); this.text.set_color(Color.green); return; } case HitType.Block: this.text.text = hs.real_hit.ToString(); this.text.set_color(Color.gray); return; case HitType.Miss: this.text.text = "Miss"; this.text.set_color(Color.yellow); return; case HitType.HPMaxChange: { string languageByTID = GameLogic.Hold.Language.GetLanguageByTID("生命上限", Array.Empty <object>()); object[] args = new object[] { languageByTID, MathDxx.GetSymbolString(hs.real_hit), MathDxx.Abs(hs.real_hit) }; this.text.text = Utils.FormatString("{0}{1}{2}", args); this.text.set_color((hs.real_hit < 0L) ? Color.red : Color.green); return; } } this.text.text = hs.real_hit.ToString(); this.text.set_color(Color.white); this.text.fontSize = this.FontSize; } }