Exemplo n.º 1
0
    private void DropStep()
    {
        if (!isDropping)
        {
            return;
        }
        isDropping = true;

        Collider2D collide = Physics2D.OverlapPoint(stepState.DropTarget);

        isHolding = false;

        if (collide == null)
        {
            Rock.SendMessage("SetSolid", true);
        }
        else
        {
            IDroppable droppable = collide.GetComponent(typeof(IDroppable)) as IDroppable;
            if (droppable != null)
            {
                StepManager.OnEndOfStep += (Action)(() =>
                {
                    GameObject.Destroy(Rock.gameObject);
                    droppable.OnDrop();
                });
            }
            else
            {
                Game.Fail();
            }
        }
    }
Exemplo n.º 2
0
 private void DropLate(IDroppable droppable)
 {
     GameObject.Destroy(Rock.gameObject);
     droppable.OnDrop();
 }