private void Start() { this.hudRoot = base.transform.parent.GetComponent <HUDRoot>(); this.isShow = false; this.offsets = this.offsetCurve.keys; this.alphas = this.alphaCurve.keys; this.scales = this.scaleCurve.keys; }
private void Awake() { if (this.m_UICamera != null) { uiCamera = this.m_UICamera; } if (this.m_WindowRoot != null) { windowRoot = this.m_WindowRoot; } if (this.m_HUDRoot != null) { hudRoot = this.m_HUDRoot; } }
void Awake() { go = gameObject; instance = this; }
private void Update() { if (this.hudRoot == null) { this.hudRoot = base.transform.parent.GetComponent <HUDRoot>(); if (this.hudRoot == null) { return; } } if (this.isShow) { float realtimeSinceStartup = Time.realtimeSinceStartup; float time = this.offsets[this.offsets.Length - 1].time; float time2 = this.alphas[this.alphas.Length - 1].time; float time3 = this.scales[this.scales.Length - 1].time; float num = Mathf.Max(time3, Mathf.Max(time, time2)); float num2 = 200f; int i = this.mList.Count; while (i > 0) { HUDText.Entry entry = this.mList[--i]; entry.jumpWord.label.pivot = UIWidget.Pivot.Center; float num3 = realtimeSinceStartup - entry.time; if (entry.color == HUDText.goldColor) { entry.jumpWord.ShowGold(); } else { entry.jumpWord.ShowDamage(entry.color == Color.clear); } if (entry.color == Color.white) { entry.jumpWord.label.color = Color.white; entry.jumpWord.label.effectStyle = UILabel.Effect.Outline; entry.jumpWord.label.effectColor = this.blackOutLine; entry.jumpWord.label.fontSize = 17; entry.offset = this.offsetCurve1.Evaluate(num3); entry.jumpWord.label.alpha = this.alphaCurve1.Evaluate(num3); float d = this.scaleCurve1.Evaluate(num3) * (float)this.hudRoot.FontSize; entry.jumpWord.label.cachedTransform.localScale = Vector3.one * d; entry.jumpWord.label.applyGradient = false; } else if (entry.color == Color.grey) { entry.jumpWord.label.color = Color.yellow; entry.jumpWord.label.effectStyle = UILabel.Effect.Outline; entry.jumpWord.label.effectColor = this.yellowOutLine; entry.jumpWord.label.fontSize = 17; entry.offset = this.offsetCurve1.Evaluate(num3); entry.jumpWord.label.alpha = this.alphaCurve1.Evaluate(num3); float d2 = this.scaleCurve1.Evaluate(num3) * (float)this.hudRoot.FontSize; entry.jumpWord.label.cachedTransform.localScale = Vector3.one * d2; entry.jumpWord.label.applyGradient = false; } else if (entry.color == Color.yellow || entry.color == Color.red || entry.color == Color.blue || entry.color == Color.green || entry.color == Color.gray) { entry.jumpWord.label.fontSize = 15; if (entry.color == Color.yellow) { entry.jumpWord.label.color = this.yellow; entry.jumpWord.label.effectColor = this.yellowOutLine; } else if (entry.color == Color.red) { entry.jumpWord.label.color = this.red; entry.jumpWord.label.effectColor = this.redOutLine; } else if (entry.color == Color.blue) { entry.jumpWord.label.color = this.blue; entry.jumpWord.label.effectColor = this.blueOutLine; } else if (entry.color == Color.green) { entry.jumpWord.label.color = this.green; entry.jumpWord.label.effectColor = this.greenOutLine; } else if (entry.color == Color.gray) { entry.jumpWord.label.color = this.gray; entry.jumpWord.label.effectColor = this.grayOutLine; } entry.jumpWord.label.effectStyle = UILabel.Effect.Outline; entry.offset = this.offsetCurve_y.Evaluate(num3); entry.offset_x = this.offsetCurve_x.Evaluate(num3); entry.jumpWord.label.alpha = this.alphaCurve.Evaluate(num3); float d3 = this.scaleCurve2.Evaluate(num3) * (float)this.hudRoot.FontSize; entry.jumpWord.label.cachedTransform.localScale = Vector3.one * d3; } else if (entry.color == Color.black) { entry.jumpWord.label.color = Color.white; entry.jumpWord.label.effectColor = this.blackOutLine; entry.jumpWord.label.fontSize = 15; entry.offset = this.pos_y.Evaluate(num3); entry.jumpWord.label.alpha = this.alpha.Evaluate(num3); float d4 = this.scale_x_y.Evaluate(num3) * (float)this.hudRoot.FontSize; entry.jumpWord.label.cachedTransform.localScale = Vector3.one * d4 * 1.4f; } else if (entry.color == Color.clear) { entry.jumpWord.label.pivot = UIWidget.Pivot.Left; entry.jumpWord.label.text = this.GetCriticalDamageStrByDamageVal(entry.jumpWord.label.text); entry.jumpWord.label.overflowMethod = UILabel.Overflow.ResizeFreely; entry.jumpWord.label.fontSize = 40; entry.jumpWord.label.color = Color.white; entry.jumpWord.label.gradientBottom = new Color32(255, 100, 0, 255); entry.jumpWord.label.gradientTop = new Color32(255, 216, 0, 255); entry.jumpWord.label.effectStyle = UILabel.Effect.Outline; entry.jumpWord.label.effectDistance = new Vector2(1f, 1f); entry.jumpWord.label.applyGradient = true; entry.jumpWord.label.effectColor = new Color32(129, 0, 0, 255); entry.jumpWord.sprite.gameObject.SetActive(true); entry.jumpWord.label.effectColor = this.redOutLine; entry.offset = this.offsetCurve_y.Evaluate(num3); entry.offset_x = this.offsetCurve_x.Evaluate(num3); entry.jumpWord.label.alpha = this.alphaCurve.Evaluate(num3); entry.jumpWord.label.cachedTransform.localScale = Vector3.one; } else if (entry.color == HUDText.goldColor) { entry.jumpWord.textMeshPro.text = this.GetGoldDispStrByGoldVal(entry.jumpWord.strValue); entry.offset = this.offsetCurve_x.Evaluate(num3); float d5 = this.scale_x_y.Evaluate(num3) * 10f; entry.jumpWord.textMeshPro.transform.localScale = Vector3.one * d5 * 1f; } if (num3 > num) { this.Delete(entry); } else { entry.jumpWord.label.enabled = true; } } int j = this.mList.Count; while (j > 0) { HUDText.Entry entry2 = this.mList[--j]; if (entry2.color == Color.red || entry2.color == Color.clear) { entry2.jumpWord.label.cachedTransform.localPosition = new Vector3(entry2.offset_x - (float)((this.mList.Count - j) * 10), entry2.offset + (float)((this.mList.Count - j) * 35), 0f); } else if (entry2.color == Color.yellow || entry2.color == Color.green || entry2.color == Color.gray) { entry2.jumpWord.label.cachedTransform.localPosition = new Vector3(-entry2.offset_x + (float)(j * 10), entry2.offset + (float)(j * 50), 0f); } else if (entry2.color == Color.blue) { entry2.jumpWord.label.cachedTransform.localPosition = new Vector3(-entry2.offset_x - (float)(j * 20), entry2.offset + (float)(j * 30), 0f); } else if (entry2.color == Color.white) { num2 = entry2.offset + num2; entry2.jumpWord.label.cachedTransform.localPosition = new Vector3(59.47f, -100f + (float)(0 * (this.mList.Count - j)) + num2, 0f); } else if (entry2.color == Color.black) { entry2.jumpWord.label.cachedTransform.localPosition = new Vector3(0f, entry2.offset, 0f); } else if (entry2.color == HUDText.goldColor) { entry2.jumpWord.label.cachedTransform.localPosition = new Vector3(0f, entry2.offset + (float)(j * 5), 0f); entry2.jumpWord.textMeshPro.transform.localPosition = new Vector3(59.47f, entry2.offset / 1.3f + (float)(j * 5), 0f); } } } }