Exemplo n.º 1
0
    public static void swap(Platform p1, Platform p2)
    {
        p1.floatToPoint(p2.transform.position);
        p2.floatToPoint(p1.transform.position);
        if (swapStarted != null) swapStarted(p1, p2);

        PlatformDelegate onFinish = (p) => {
            if (!p1.floating && !p2.floating && swapFinished != null) swapFinished(p1, p2);
        };
        p1.stoppedFloating += onFinish;
        p2.stoppedFloating += onFinish;
    }