override public void UpdateFade(float range) { float alpha = AlphaCulc.GetValue(range); Debug.Log(alpha); Color color = FadeImage.color; color.a = alpha; FadeImage.color = color; }
// Update is called once per frame void Update() { if (MoveNow == true) { Counter += Time.deltaTime; if (Counter >= 3f) { Counter = 3f; MoveNow = false; } float x = XCulc.GetValue(Counter); float y = YCulc.GetValue(Counter); MoveObject.transform.localPosition = new Vector3(x, y, 0f); } }
void Update() { if (NowState == State.FadeIn) { PassTime += Time.deltaTime; float alpha = FadeInCulc.GetValue(PassTime); Debug.Log(alpha); CuFadeObjectBase.UpdateFade(alpha); if (PassTime >= AnimationTime) { NowState = State.FadeWait; PassTime = 0f; } } else if (NowState == State.FadeOut) { PassTime += Time.deltaTime; float alpha = FadeOutCulc.GetValue(PassTime); Debug.Log(alpha); CuFadeObjectBase.UpdateFade(alpha); if (PassTime >= AnimationTime) { NowState = State.None; gameObject.SetActive(false); EndCallback?.Invoke(); } } else if (NowState == State.FadeWait) { PassTime += Time.deltaTime; if (PassTime >= WaitTime) { NowState = State.None; EndCallback?.Invoke(); } } }