private void ProgressCycle() { cyclesCount++; currentCycle = cyclesQueue.Dequeue(); cyclesQueue.Enqueue(currentCycle); timer = currentCycle.Duration; currentCycle.OnCycleStart.Raise(); }
private void Awake() { var orderedCycles = new [] { cyclesSettings[cyclesOrder[0]], cyclesSettings[cyclesOrder[1]], cyclesSettings[cyclesOrder[2]] }; for (var i = 0; i < 3; i++) { orderedCycles[i].OnCycleEnd = orderedCycles[(i + 1) % 3].OnCycleStart; } currentCycle = orderedCycles[0]; cyclesQueue = new Queue <CycleObject>(orderedCycles); }
private void TweenLight(CycleObject cycle) { if (animationSequence.active) { animationSequence.Kill(true); } animationSequence = DOTween.Sequence() .Join(DOTween.To(() => globalLight.color, c => globalLight.color = c, cycle.GlobalLightColor, animationDuration)) .Join(DOTween.To(() => globalLight.intensity, i => globalLight.intensity = i, cycle.GlobalLightIntensity, animationDuration)); }