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; private static readonly int BorderColor = Shader.PropertyToID("_BorderColor"); public bool IsPermanent { get; set; } protected override void Setup() { GetComponent().material.SetColor(BorderColor, IsPermanent ? permanentColor : temporaryColor); } protected override float Duration() { return IsPermanent ? permanentDuration : temporaryDuration; } protected override void OnCollect(Player player) { GameManager.Singleton.SpawnBall(player, IsPermanent); } } }