Пример #1
0
 public void SpawnShadows()
 {
     CancelInvoke();
     if (timeScale.getScale() < 1f)
     {
         InvokeRepeating("DropShadow", timeScale.getScale() * dropRateMultiplier, timeScale.getScale() * dropRateMultiplier);
     }
 }
Пример #2
0
    void Update()
    {
        if (!dead)
        {
            // Gain variable bar filling based on scale
            barValue += ((timeScale.getScale() - 1) * scaleSpeed + timeBar.maxValue / 20f) * Time.deltaTime;

            // Forces the time to stay within 0 - 1000
            if (barValue < 0)
            {
                barValue = 0f;
            }
            if (barValue > 1000)
            {
                barValue = 1000;
            }
        }
        timeBar.value = barValue;
    }
Пример #3
0
 private void FixedUpdate()
 {
     foreach (Renderer r in rend)
     {
         Color c = r.material.color;
         if (obeyTimescale)
         {
             c.a -= fadeRate * timeScale.getScale();
         }
         else
         {
             c.a -= fadeRate;
         }
         if (c.a <= 0f)
         {
             c.a = 0f;
             Destroy(gameObject);
         }
         r.material.color = c;
     }
 }
Пример #4
0
    public void UpdateVolumes()
    {
        fromVignette   = profile.vignette.settings.intensity;
        fromDof        = profile.depthOfField.settings.aperture;
        fromSaturation = profile.colorGrading.settings.basic.saturation;
        fromTemp       = profile.colorGrading.settings.basic.temperature;

        lerp = 0f;

        /* NOTE: Lots of magic numbers here.
         * I created basic mathematical equations to get our target variables
         * to reach desired values, dependent on what our time scale is.
         */
        if (timeScale.getScale() < 1f)
        {
            //Vignette
            targetVignette = (1f - timeScale.getScale()) / 1.2f;
        }
        else if (timeScale.getScale() > 1f)
        {
            //Dof
            targetDof = 15f - (2f * timeScale.getScale());

            //Saturation
            targetSaturation = 1f - ((timeScale.getScale() - 1f) / 2f);

            //Temperature
            targetTemp = timeScale.getScale() * 20f;
        }
        else
        {
            targetVignette   = 0f;
            targetDof        = 13f;
            targetSaturation = 1f;
            targetTemp       = 0f;
        }
    }
Пример #5
0
 protected float getTimeScale()
 {
     return(timeScale.getScale() * personalTimeScale);
 }
Пример #6
0
 protected float getTimeScale()//TODO: not sure if weapons have colliders, maybe use send message to children when altering personal timescales
 {
     return(timeScale.getScale());
 }
Пример #7
0
 public void rotate(float deltaTime)
 {
     transform.Rotate(Vector3.up, timeScale.getScale() * deltaTime * rotateSpeed);
 }
Пример #8
0
 // Update is called once per frame
 void Update()
 {
     timeText.text = "x" + timeScale.getScale().ToString();
 }