Let $X$ be the $2$-sphere. Let $\mathcal D$ be the bounded derived category of sheaves over $X$. Let $\underline{\mathbb C}_X$ be the constant sheaf over $X$ with stalks isomorphic to $\mathbb C$.
Then why is $\text{Hom}_{\mathcal D}(\underline{\mathbb C}_X,\underline{\mathbb C}_X[2]) \cong \mathbb C$?
The morphism in the derived category is defined to be the equivalence class of "roofs". By this definition, I should find "roofs" like $\underline{\mathbb C}_X \overset{q}{\leftarrow} F \overset{u}{\rightarrow} \underline{\mathbb C}_X[2]$, where $q$ is a quasi-isomorphism, and then determine the equivalence of them. But I have no idea how I can do this.
Through the comments under this post, I know that $\text{Hom}_{\mathcal D}(\underline{\mathbb C}_X,\underline{\mathbb C}_X[2]) =\text{Ext}^2(\underline{\mathbb C}_X, \underline{\mathbb C}_X)$, calculated in the category of sheaves over $X$. But I still don't know why this is true from the definition.
More generally, if $A,B$ in $\mathcal D$ do not just concentrate in one degree, how can I better understand and calulate $\text{Hom}_{\mathcal D}(A,B)$?
Many thanks!