using UnityEngine; namespace Game { public class NewBall : Collectable { public float permanentDuration; public float temporaryDuration; [ColorUsage(true, true)] public Color permanentColor; [ColorUsage(true, true)] public Color temporaryColor; public bool IsPermanent { get; set; } protected override void Setup() { GetComponent().material.color = IsPermanent ? permanentColor : temporaryColor; } protected override float Duration() { return IsPermanent ? permanentDuration : temporaryDuration; } protected override void OnCollect(Player player) { GameManager.Singleton.SpawnBall(player, IsPermanent); } } }