Compare commits
2 Commits
c13404077c
...
80cc8af228
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80cc8af228 | ||
|
|
d8b62e6ac2 |
@ -60,7 +60,22 @@ namespace QFramework
|
|||||||
int.TryParse(index, out matIndex);
|
int.TryParse(index, out matIndex);
|
||||||
if (string.IsNullOrEmpty(matName) == false)
|
if (string.IsNullOrEmpty(matName) == false)
|
||||||
{
|
{
|
||||||
mesh.materials[matIndex] = Resources.Load<Material>("Mat/" + matName);
|
//mesh.materials[matIndex].CopyMatchingPropertiesFromMaterial();
|
||||||
|
var mat = Resources.Load<Material>("Mat/" + matName);
|
||||||
|
var mats = new Material[mesh.materials.Length];
|
||||||
|
for (int i = 0; i < mesh.materials.Length; i++)
|
||||||
|
{
|
||||||
|
if (i == matIndex)
|
||||||
|
{
|
||||||
|
mats[i] = mat;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mats[i] = mesh.materials[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mesh.materials = mats;
|
||||||
}
|
}
|
||||||
if (mainTexture != null)
|
if (mainTexture != null)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user