// Update is called once per frame void Update() { if (actionTime >= maxActionTime) { //Destroy(gameObject); GameSceneManager.ChangeActionFinished(); return; } actionTime += Time.deltaTime; float rate = actionTime / maxActionTime; sprite.color = new Color(sprite.color.r, sprite.color.g, sprite.color.b, rate); }