void Update() { if (!once) { once = true; textmesh.text = cstext; transform.DOMoveY(transform.position.y + 3.0f, 0.2f); textmesh.DOFade(0f, 1.5f); mesh.DOFade(0f, 1.5f); } //cstext = " "; }
public void SetValue(string newValue) { text.gameObject.SetActive(true); text.text = newValue; text.transform.localPosition += new Vector3(0.0f, 0.1f, 0.0f); text.color = new Color(1.0f, 1.0f, 1.0f, 0.0f); text.DOFade(1.0f, 0.1f); text.transform.DOLocalMove(Vector3.zero, 0.1f); }
public void Init(int dmg) { text.text = "0"; var seq = DOTween.Sequence(); seq.Append(text.transform.DOLocalMove(new Vector3(Random.Range(-3, 3), 3, Random.Range(-3, 3)), 0.33f).SetEase(Ease.OutCubic)); seq.Join(text.transform.DOPunchScale(Vector3.one * .05f * dmg, 0.9f, 2, 0.2f).SetEase(Ease.OutBounce)); seq.Join(DOVirtual.Float(0, (float)dmg + 0.5f, 0.466f, value => text.text = $"{Mathf.FloorToInt(value)}")); seq.Append(text.DOFade(0, 3.0f)); seq.AppendCallback(() => { Destroy(gameObject); }); seq.Play(); }
private void Start() { m_textMesh.DOFade(0f, duration / 2f).SetDelay(duration / 2); transform.DOLocalMoveY(offsetY, duration).SetEase(Ease.OutQuart).OnComplete(() => Destroy(gameObject)); }