They don't have to be in the same .material file. You could have as many .material files as you want with any number of materials inside each one, but when calling you have to call the material file name that would exist inside any of those .material files.
Obviously, the .material files have to exist within the asset library or your project
Check out the "$(Tech Demos)\Lua\Entity Materials\setEntityMaterial" tech demo.
In this demo we change the material when the number 1 or 2 key is pressed, which sets the material either as "Proto_Red_adv" or "Proto_Sand_adv", both of these materials exist in different .material files.
Hope this helps

