U
U
Uncle Bogdan2021-10-18 21:43:32
Unity
Uncle Bogdan, 2021-10-18 21:43:32

Why is it impossible to pass arguments to the button, except for the standard ones ( int, string, etc. )?

Wrote this code:

public void ChangeMaterial(Material material)
    {
        foreach(SkinnedMeshRenderer meshRenderer in playerMeshRenderers)
        {
            meshRenderer.material = null;
        }
    }


But due to the Material argument, it is not shown when I want to add a call to this method for the button.

How to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2021-10-18
@GavriKos

How to fix - use a different architectural approach, in which the parameters will be passed differently.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question