123456789101112131415161718192021222324 |
- using UnityEngine;
- public class AddonsHandler : MonoBehaviour
- {
- [SerializeField]
- private GameObject _addons;
- private static AddonsHandler _instance;
- // Use this for initialization
- internal void Start () {
- if (_instance)
- {
- Destroy(gameObject);
- }
- else
- {
- _instance = this;
- var obj = (GameObject)Instantiate(_addons);
- obj.transform.parent = transform;
- DontDestroyOnLoad(gameObject);
- }
- }
-
- }
|