public void Disable() { isDisabled = true; foreach (var VARIABLE in this.GetComponentsInChildren <SpriteRenderer>()) { VARIABLE.DOFade(0, GameplayConstants.KilledCardFadeOutDuration); } foreach (TextMeshPro textMeshPro in this.GetComponentsInChildren <TextMeshPro>()) { textMeshPro.DOFade(0, GameplayConstants.KilledCardFadeOutDuration); } }
public void Kill() { Sequence seq = DOTween.Sequence(); seq.Append(this.GetComponent <SpriteRenderer>().DOFade(0, GameplayConstants.KilledCardFadeOutDuration)); seq.AppendCallback(() => GameObject.Destroy(this.gameObject)); foreach (var VARIABLE in this.GetComponentsInChildren <SpriteRenderer>()) { VARIABLE.DOFade(0, GameplayConstants.KilledCardFadeOutDuration); } foreach (TextMeshPro textMeshPro in this.GetComponentsInChildren <TextMeshPro>()) { textMeshPro.DOFade(0, GameplayConstants.KilledCardFadeOutDuration); } ExitSlot(); }