private IEnumerator FadeInRoutine() { Color c = _image.color; c.a = 0f; _image.color = c; while (c.a < 1f) { c.a += Time.deltaTime * fadeRate; _image.color = c; yield return(null); } c.a = 1f; _image.color = c; onFadeInEnd?.InvokeOneTime(); }
private void Update() { if (!IsScrolling || Ended) { return; } if (_entryIndex + 1 >= entries.Length) { Ended = true; onCreditsEnd?.InvokeOneTime(); return; } float y = textElement.transform.localPosition.y - creditsScrollRate * Time.deltaTime; textElement.transform.localPosition = new Vector3(textElement.transform.localPosition.x, y, textElement.transform.localPosition.z); //Debug.Log($"Y: {y} | H: {Screen.height}"); if (y < -Screen.height) { textElement.transform.localPosition = new Vector3(textElement.transform.localPosition.x, Screen.height + 10f, textElement.transform.localPosition.z); _entryIndex++; textElement.text = entries[_entryIndex]; } }
private void OnFlockTargetReached() { //flySpeed -= Time.deltaTime * WorldManager.instance.usakiDecelerationRate; //flySpeed = Mathf.Clamp(flySpeed, WorldManager.instance.minUsakiSpeed, WorldManager.instance.maxUsakiSpeed); onFlockTargetReached?.InvokeOneTime(); }