public void SpawnShadows() { CancelInvoke(); if (timeScale.getScale() < 1f) { InvokeRepeating("DropShadow", timeScale.getScale() * dropRateMultiplier, timeScale.getScale() * dropRateMultiplier); } }
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; }
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; } }
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; } }
protected float getTimeScale() { return(timeScale.getScale() * personalTimeScale); }
protected float getTimeScale()//TODO: not sure if weapons have colliders, maybe use send message to children when altering personal timescales { return(timeScale.getScale()); }
public void rotate(float deltaTime) { transform.Rotate(Vector3.up, timeScale.getScale() * deltaTime * rotateSpeed); }
// Update is called once per frame void Update() { timeText.text = "x" + timeScale.getScale().ToString(); }