Skip to content

Instantly share code, notes, and snippets.

@AVatch
Created June 5, 2017 14:02
Show Gist options
  • Save AVatch/717ae7df2920432aef6113f60671f9af to your computer and use it in GitHub Desktop.
Save AVatch/717ae7df2920432aef6113f60671f9af to your computer and use it in GitHub Desktop.
Unity App Manager Singleton
using System;
using System.Collections;
using System.Collections.Generic;
using System.Net;
using System.Linq;
using UnityEngine;
namespace Arlane
{
public class AppManager : MonoBehaviour
{
public static AppManager instance = null;
void Awake()
{
if ( instance == null )
{
instance = this;
}else if(instance != this)
{
Destroy(gameObject);
}
DontDestroyOnLoad(gameObject);
}
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment