コード例 #1
0
    private IEnumerator DestroyCoroutine()
    {
        yield return(CoroutineAnimation.Animate(
                         transform.localScale,
                         Vector3.zero,
                         .3f,
                         (s) => transform.localScale = s));

        Destroy(gameObject);
    }
コード例 #2
0
ファイル: MovablePiece.cs プロジェクト: lucasncs/match-3
    public void Move(int toX, int toY, float time)
    {
        if (_moveCoroutine != null)
        {
            StopCoroutine(_moveCoroutine);
        }

        _piece.ChangeCoordinates(toX, toY);

        _moveCoroutine = StartCoroutine(CoroutineAnimation.Animate(
                                            transform.localPosition,
                                            _piece.Grid.GetCoordinatesWorldPosition(toX, toY),
                                            time,
                                            (p) => transform.localPosition = p));
    }