public void OnDestroy()
        {
            StaticBatching batching = StaticBatching.GetInstanceOnDestroy();

            if (!Essentials.UnityIsNull(batching))
            {
                batching.DestroyVisualRepresentations(this);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Enforces the singleton pattern.
 /// </summary>
 private void Awake()
 {
     if (Essentials.UnityIsNull(_instance))
     {
         _instance = this;
     }
     else
     {
         Debug.LogError("Singleton pattern violated! Destroying StaticBatching!", this.gameObject);
         Destroy(this);
     }
 }