public void SetMeshImageAll(int textureID, Texture2D newTexture) { MaterialUnit curUnit = null; for (int i = 0; i < _matUnits.Count; i++) { curUnit = _matUnits[i]; if (curUnit._textureID != textureID) { continue; } curUnit.RequestImage(newTexture); //curUnit.RefreshLinkedMeshes(); } }
public void SetMeshImageAll(int textureID, Texture2D newTexture) { MaterialUnit curUnit = null; for (int i = 0; i < _matUnits.Count; i++) { curUnit = _matUnits[i]; //Debug.Log("[" + i + "] : " + curUnit._textureID); if (curUnit._textureID != textureID) { continue; } curUnit.RequestImage(newTexture); //curUnit.RefreshLinkedMeshes(); } if (_clippedMatUnits != null && _clippedMatUnits.Count > 0) { ClippedMatMeshSet curCMMSet = null; for (int i = 0; i < _clippedMatUnits.Count; i++) { curCMMSet = _clippedMatUnits[i]; if (!curCMMSet.IsValid()) { continue; } if (curCMMSet._matInfo._textureID != textureID) { continue; } curCMMSet._clippedMesh.SetClippedMaterialPropertyByBatch_Texture(newTexture); } } }