Esempio n. 1
0
    public void OnClickUp()
    {
        Target target = cubeTargetFinder.GetNearestTarget();

        if (!target || !target.isEmpty)
        {
            transform.position = startPos;
        }
        else
        {
            UndoSystem.instance.Move(this);
            ClonableIndicatorActive(false);
            isOnTarget    = true;
            currentTarget = target;
            currentTarget.Fill();
            if (currentTarget.direction == Vector2.zero)
            {
                cubeAnimations.SettleDownTarget(target, CreateClone);
            }
            else
            {
                loopDir = currentTarget.direction;
                cubeAnimations.SettleDownTarget(target, CreateLoop);
            }
        }
    }
Esempio n. 2
0
    public void ControlTarget()
    {
        Target target = cubeTargetFinder.GetNearestTarget();

        if (!target || !target.isEmpty)
        {
            isDestroyable = true;
            cubeAnimations.JustGoDown();
        }
        else
        {
            currentTarget = target;
            currentTarget.Fill();
            if (currentTarget.direction == Vector2.zero)
            {
                cubeAnimations.SettleDownTarget(target, () => { mainCube.OnMovementDone?.Invoke(); });
            }
            else
            {
                loopDir = currentTarget.direction;
                cubeAnimations.SettleDownTarget(target, CreateLoop);
            }
        }
    }