  We exploit a relation between the mean number $N_{m}$ of minima of random
Gaussian surfaces and extreme eigenvalues of random matrices to understand the
critical behaviour of $N_{m}$ in the simplest glass-like transition occuring in
a toy model of a single particle in $N$-dimensional random environment, with
$N\gg 1$. Varying the control parameter $\mu$ through the critical value
$\mu_c$ we analyse in detail how $N_{m}(\mu)$ drops from being exponentially
large in the glassy phase to $N_{m}(\mu)\sim 1$ on the other side of the
transition. We also extract a subleading behaviour of $N_{m}(\mu)$ in both
glassy and simple phases. The width $\delta{\mu}/\mu_c$ of the critical region
is found to scale as $N^{-1/3}$ and inside that region $N_{m}(\mu)$ converges
to a limiting shape expressed in terms of the Tracy-Widom distribution.
