Канал про геймдев, посвящённый разработке игр, разнообразным ассетам и мемам в Unity.
Реклама: @taifunblade
Post #537
1.23K
UN @unityxur
Showing posts older than #540 · Back to latest







class GameManager(MonoBehaviour):
static instance as GameManager
def Awake():
if instance == null:
instance = self
DontDestroyOnLoad(gameObject)
else:
Destroy(gameObject)
public class GameManager : MonoBehaviour
{
public static GameManager instance;
void Awake()
{
if (instance == null)
{
instance = this;
DontDestroyOnLoad(gameObject);
}
else
{
Destroy(gameObject);
}
}
}