using System.Collections; using System.Collections.Generic; using UnityEngine; public class FullscreenClearBubbleBehavior : MonoBehaviour { const float SpreadSpeed = 120f; const float Lifetime = 2f; float Age = 0f; private SphereCollider ClearCollider; // Start is called before the first frame update void Start() { ClearCollider = gameObject.GetComponent(); } // Update is called once per frame void Update() { Age += Time.deltaTime; if (Age > Lifetime) { Destroy(gameObject); return; } float radius = SpreadSpeed * Time.deltaTime; ClearCollider.radius += radius; } }