R
R
Roman Morar2021-09-19 17:45:17
C++ / C#
Roman Morar, 2021-09-19 17:45:17

Why is the Source Image not checked?

void Start()
{
spr1 = Resources.Load("камень_0");
spr2 = Resources.Load("fs");
}
void IPointerEnterHandler.OnPointerEnter(PointerEventData eventData)
{
if (GetComponent().sprite = spr1)
{
Debug.Log("Enter");
}

}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2021-09-19
@GavriKos

Or maybe it's better to start with the basics of the language?
if (GetComponent().sprite = spr1)
There is a syntax error here (even if you add the component type) - and the compiler tells you about it.
And to make a comparison through resources is the most incorrect

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question