コード例 #1
0
        private void Awake()
        {
            if (s_Instance != null && s_Instance != this)
            {
                Destroy(gameObject);
            }

            s_Instance = this;
            DontDestroyOnLoad(gameObject);
        }
コード例 #2
0
 void OnApplicationQuit()
 {
     s_Instance = null;
 }