Exemplo n.º 1
0
 private void ChangeColor()
 {
     if (sr == null)
     {
         Debug.LogError("ERROR: sprite renderer is null");
         return;
     }
     sr.color = ec.GetColor(elementType);
 }
Exemplo n.º 2
0
    // 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);
    }
Exemplo n.º 3
0
    public void SetElement(ElementType e)
    {
        element = e;

        if (e == ElementType.NONE)
        {
            image.color = Color.white;
        }
        else
        {
            image.color = ec.GetColor(e);
        }
    }