private void OnGarbageAdded(GridScript.GarbageStored g) { var b = blocks.FirstOrDefault(el => el.GarbageStored.Equals(g)); if (b == null) { return; } blocks.Remove(b); b.fill.fillAmount = 1f; var rt = ((RectTransform)b.transform); rt.DOKill(); rt.SetParent(rt.parent.parent, true); var seq = DOTween.Sequence(); //seq.Join(rt.DOAnchorPosX(-75, 0.15f).SetEase(Ease.OutCubic)); seq.Join(rt.DOScale(0.33f, 0.25f).SetEase(Ease.InBack)); seq.Append(rt.DOAnchorPosY(rt.anchoredPosition.y + 500, 0.35f) .SetEase(Ease.OutCubic)); seq.OnComplete(() => { if (b) { Destroy(b.gameObject); } }); }
private void OnGarbageStored(GridScript.GarbageStored obj) { RefreshBlockList(); }