Ejemplo n.º 1
0
 private void Deregister()
 {
     if (Application.isPlaying)
     {
         ModifierManager.Deregister(this);
     }
 }
Ejemplo n.º 2
0
 private void Deregister()
 {
     if (Application.isPlaying && gameObject.activeInHierarchy)
     {
         ModifierManager.Deregister(this);
     }
 }
Ejemplo n.º 3
0
        private void OnEnable()
        {
            //Singleton
            if (singleton == null)
            {
                singleton = this;
            }
            else if (singleton != this)
            {
                if (Application.isPlaying)
                {
                    Destroy(gameObject);
                }
                else
                {
                    DestroyImmediate(gameObject, true);
                }
                return;
            }

            //Initiailize lists
            perFrameModifiers = new List <Modifier>();
            tenModifiers      = new List <Modifier>();
            oneModifiers      = new List <Modifier>();

            //Start co-routines
            StartCoroutine(TenTimesPerSecond());
            StartCoroutine(OncePerSecond());
        }