private void ChangeColor() { if (sr == null) { Debug.LogError("ERROR: sprite renderer is null"); return; } sr.color = ec.GetColor(elementType); }
// Start is called before the first frame update void Start() { amountText = GetComponentInChildren <Text>(); image = GetComponentInChildren <Image>(); ec = FindObjectOfType <ElementController>(); player = FindObjectOfType <Player>(); image.color = ec.GetColor(elementType); }
public void SetElement(ElementType e) { element = e; if (e == ElementType.NONE) { image.color = Color.white; } else { image.color = ec.GetColor(e); } }