2. Given that when $0 \leqslant \theta \leqslant \frac{\pi}{2}$, it always holds that $\cos ^{2} \theta+2 m \sin \theta-2 m-2<0$. Then the range of real number $m$ is $\qquad$.
2. $m>-\frac{1}{2}$.

Let $x=\sin \theta$. Then the original inequality becomes $x^{2}+1>2 m x-2 m(0 \leqslant x \leqslant 1)$. Let $y_{1}=x^{2}+1, y_{2}=2 m x-2 m$.

In the Cartesian coordinate system of Figure 8, draw the graphs of $y_{1}$ and $y_{2}$, where $y_{2}$ is a family of lines passing through the point $(1,0)$. From the graph, to ensure that $y_{1}>y_{2}$ holds for all $[0,1]$, it is sufficient that the intersection point of $y_{2}$ with the $y$-axis is below the point $(0,1)$.
Therefore, $-2 m<\frac{1}{2}$.