Question Changing CUA material at runtime / loading mat. from assetbundle

cenXaur

Well-known member
Messages
19
Reactions
12
Points
53
Twitter
cenxaur
Hello. Please help me.
I have a CUA and a script controlling this CUA. I want to change a material of the asset at runtime.
In this script I need to load and use a material which is contained in the assetbundle like this:

Material mat = assetbundle.LoadAsset("Material.mat", typeof(Material)) as Material;

However how do I get the refference to the assetbundle from the VAM script?
Is it even possible to get any material from the assetbundle at runtime?
 
Back
Top Bottom