Esempio n. 1
0
 private void Update()
 {
     if (!this.adaptOn)
     {
         return;
     }
     this.step++;
     this.acc += Time.deltaTime;
     if (this.step % this.frameCount == 0)
     {
         this.fps  = (int)((float)this.frameCount / this.acc);
         this.step = 0;
         this.acc  = 0f;
         if (this.fps < this.particleFPS)
         {
             ParticleAdapter.AdaptDown();
         }
         if (this.checkShadow)
         {
             if (this.fps < this.shadowFPS)
             {
                 this.shadowAcc++;
                 if (this.shadowAcc > 10)
                 {
                     AdaptCenter.TurnOffShadows();
                     this.checkShadow = false;
                 }
             }
             else
             {
                 this.shadowAcc = 0;
             }
         }
     }
 }
Esempio n. 2
0
    private static void Init()
    {
        GameObject gameObject = new GameObject("AdaptCenter");

        AdaptCenter._instance = gameObject.AddComponent <AdaptCenter>();
    }