本文整理汇总了C#中Part.FindModelTransforms方法的典型用法代码示例。如果您正苦于以下问题:C# Part.FindModelTransforms方法的具体用法?C# Part.FindModelTransforms怎么用?C# Part.FindModelTransforms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Part
的用法示例。
在下文中一共展示了Part.FindModelTransforms方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: enable
public void enable(Part part)
{
foreach (String meshName in meshNames)
{
Transform[] trs = part.FindModelTransforms(meshName);
if (trs == null || trs.Length == 0)
{
continue;
}
foreach (Transform tr in trs)
{
enableTexture(tr);
}
}
}
示例2: enable
public void enable(Part part)
{
Transform[] trs = part.FindModelTransforms(meshName);
if(trs==null || trs.Length==0)
{
//MonoBehaviour.print ("Error, could not locate model transform for texture switch target for name: "+meshName)
//TODO add debug/extra logging option to catch this stuff; could be useful, but is also a 'normal' error for the current texture-set layout
return;
}
foreach(Transform tr in trs)
{
if(tr.renderer==null){MonoBehaviour.print ("ERROR: transform does not contain a renderer for mesh name: "+meshName);continue;}
Renderer r = tr.renderer;
//TODO check/update shader
Material m = r.material;
if(!String.IsNullOrEmpty(diffuseTextureName)){m.mainTexture = GameDatabase.Instance.GetTexture(diffuseTextureName, false);}
if(!String.IsNullOrEmpty(normalTextureName)){m.SetTexture("_BumpMap", GameDatabase.Instance.GetTexture(normalTextureName, true));}
if(!String.IsNullOrEmpty(emissiveTextureName)){m.SetTexture("_Emissive", GameDatabase.Instance.GetTexture(emissiveTextureName, false));}
}
}