Hello everyone I want to change my materials tiling offset in code, but the only way I found to access it other than drag-dropping to a public field in inspector is to check by name. But I then noticed the name is suffixed with ' (Instance)' .
So it seems a little odd to me having to access it this way, is there another way that I don't know about?
foreach(Material m in GetComponent<MeshRenderer>().materials)
{
if (m.name == "card_front (Instance)")
{
m.mainTextureOffset = new Vector2(value * 1/13f, (int)suit * 1/5f);
}
}