protected override void UpdateElement() { if (falling) { timeSpent += Time.deltaTime; ray.position = Vector3.Lerp(ray.position, downPosition, timeSpent / fallingTime); lights.intensity = Random.Range(0, 8); ray.eulerAngles = new Vector3(Random.Range(-5, 5), Random.Range(-5, 5), Random.Range(-5, 5)); if (timeSpent >= fallingTime) { // particles.Play(); lights.enabled = false; ray.position = upPosition; ray.gameObject.SetActive(false); falling = false; collider.enabled = false; timeTillNext = Random.Range(cooldownMin, cooldownMax); } return; } timeTillNext -= Time.deltaTime; if (timeTillNext <= 0) { timeSpent = 0; falling = true; cameraShake.Action(1 - (world.DistanceToPlayer(transform.position) * 0.06f)); lights.enabled = true; ray.gameObject.SetActive(true); collider.enabled = true; } }