Files
uni/third/semester1/CT3536: Games Programming/notes/_minted-CT3536-Notes/ECF18BF32B54DDFC0074E282F573DBC8A97D9E8903456DD8DEC827D96A24153A.pygtex
2023-12-07 02:05:57 +00:00

9 lines
553 B
Plaintext

\begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}]
\PYG{n}{GameObject}\PYG{+w}{ }\PYG{n}{go}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{Instantiate}\PYG{p}{(}\PYG{n}{Resources}\PYG{p}{.}\PYG{n}{Load}\PYG{p}{(}\PYG{n}{prefabName}\PYG{p}{));}
\PYG{c+c1}{// later on, assuming we still have a reference to the object:}
\PYG{n}{GameObject}\PYG{p}{.}\PYG{n}{Destroy}\PYG{p}{(}\PYG{n}{go}\PYG{p}{);}
\PYG{c+c1}{// or}
\PYG{n}{GameObject}\PYG{p}{.}\PYG{n}{DestroyImmediate}\PYG{p}{(}\PYG{n}{go}\PYG{p}{);}
\end{Verbatim}