Esempio n. 1
0
 private void OnDestroy()
 {
     if (Main == null)
     {
         Main = null;
     }
 }
Esempio n. 2
0
        public VFXInstantiator Instantiator = new VFXInstantiator(); // Implement you own to instantiate from a pool or similar

        private void Start()
        {
            if (_isMain)
            {
                if (Main != null)
                {
                    Debug.LogError("Duplicate VFXManager marked as main!", Main.gameObject);
                    Destroy(gameObject);
                }
                Main = this;
            }
        }