Пример #1
0
    void Remove()
    {
        //Destroy the last piece on the stack and revert to the values before that
        if (pieceHistory.Count > 0)
        {
            TrackSegment lastPiece = pieceHistory.Pop();
            Destroy(lastPiece.gameObject);
            checkpointCounter -= segmentCount;
            if (pieceHistory.Count > 0)
            {
                lastPiece = pieceHistory.Peek();
                lastPiece.GetData(out x, out y, out ax, out bx, out cx, out ay, out by, out cy);
                return;
            }
        }

        //Stack is empty, use default values
        x  = 0;
        y  = 0;
        ax = 10;
        bx = 0;
        cx = -10;
        ay = 0;
        by = 0;
        cy = 0;
    }