Exemplo n.º 1
0
 private void OnDestroy()
 {
     if (Main == this)
     {
         Main = null;
     }
 }
Exemplo n.º 2
0
        private void Start()
        {
            _poolContainer = new GameObject("Instances").transform;
            _poolContainer.SetParent(transform);
            _poolContainer.gameObject.SetActive(false);
            _internalPool = GameObjectPoolManager.CreatePool(prefab, maxSize, preCache, false, _poolContainer);
            if (dontDestroyOnLoad)
            {
                DontDestroyOnLoad(gameObject);
            }

            if (hideInInspectorOnRun)
            {
                gameObject.hideFlags = HideFlags.HideInHierarchy | HideFlags.HideInInspector;
            }
        }
Exemplo n.º 3
0
 void Awake()
 {
     _transform           = transform;
     _transform.hideFlags = HideFlags.HideInInspector | HideFlags.HideInHierarchy;
     Main = this;
 }