Ejemplo n.º 1
0
    void CtrlFall()
    {
        var distance = transform.Position2D().Distance(fallTo.transform.position);

        if (distance <= fallTo.FallCompleteRadius)
        {
            fallTo.FallCollectableComplete();
            gameObject.SetActive(false);
            return;
        }
        transform.position = Vector2.MoveTowards(
            transform.position,
            fallTo.transform.position,
            fallSpeed * Time.deltaTime
            );
    }