private string[] BuildTextureNameMap([NotNull] PmxModel model) { var materials = model.Materials; var nameList = new List <string>(); foreach (var material in materials) { if (!string.IsNullOrEmpty(material.TextureFileName)) { nameList.Add(material.TextureFileName); } if (!string.IsNullOrEmpty(material.SphereTextureFileName)) { nameList.Add(material.SphereTextureFileName); } if (!string.IsNullOrEmpty(material.ToonTextureFileName) && !ToonNameRegex.IsMatch(material.ToonTextureFileName)) { nameList.Add(material.ToonTextureFileName); } } return(nameList.Distinct().ToArray()); }
private void BuildTextureNameMap([NotNull] PmxModel model) { var materials = model.Materials; if (materials == null) { return; } var nameList = new List <string>(); foreach (var material in materials) { if (!string.IsNullOrEmpty(material.TextureFileName)) { nameList.Add(material.TextureFileName); } if (!string.IsNullOrEmpty(material.SphereTextureFileName)) { nameList.Add(material.SphereTextureFileName); } if (!string.IsNullOrEmpty(material.ToonTextureFileName) && !ToonNameRegex.IsMatch(material.ToonTextureFileName)) { nameList.Add(material.ToonTextureFileName); } } _textureNameList.AddRange(nameList.Distinct()); }