本文整理汇总了C#中pb_Object.SetObjectMaterial方法的典型用法代码示例。如果您正苦于以下问题:C# pb_Object.SetObjectMaterial方法的具体用法?C# pb_Object.SetObjectMaterial怎么用?C# pb_Object.SetObjectMaterial使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pb_Object
的用法示例。
在下文中一共展示了pb_Object.SetObjectMaterial方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RefreshSelectedFacePreview
void RefreshSelectedFacePreview()
{
pb_Face face = new pb_Face(currentSelection.face); // Copy the currently selected face
face.ShiftIndicesToZero(); // Shift the selected face indices to zero
Vector3[] verts = currentSelection.pb.VerticesInWorldSpace(
currentSelection.face); // Copy the currently selected vertices in world space.
// World space so that we don't have to apply transforms
// to match the current selection.
// Now go through and move the verts we just grabbed out about .1m from the original face.
Vector3 normal = pb_Math.PlaneNormal(verts);
for(int i = 0; i < verts.Length; i++)
verts[i] += normal.normalized * .01f;
if(preview)
Destroy(preview.gameObject);
preview = ProBuilder.CreateObjectWithVerticesFaces(verts, new pb_Face[1]{face});
preview.SetName("Preview");
preview.SetObjectMaterial(previewMaterial);
}