You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
669 B

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<SpriteRenderer>().material.color = IsPermanent ? permanentColor : temporaryColor;
}
protected override float Duration() {
return IsPermanent ? permanentDuration : temporaryDuration;
}
protected override void OnCollect(Player player) {
GameManager.Singleton.SpawnBall(player, IsPermanent);
}
}
}