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.

31 lines
768 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;
private static readonly int BorderColor = Shader.PropertyToID("_BorderColor");
public bool IsPermanent { get; set; }
protected override void Setup() {
GetComponent<SpriteRenderer>().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);
}
}
}