本文整理汇总了C#中pb_Object.SetFaceMaterial方法的典型用法代码示例。如果您正苦于以下问题:C# pb_Object.SetFaceMaterial方法的具体用法?C# pb_Object.SetFaceMaterial怎么用?C# pb_Object.SetFaceMaterial使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pb_Object
的用法示例。
在下文中一共展示了pb_Object.SetFaceMaterial方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ClickShortcutCheck
/**
* Applies the currently queued material to the selected face and eats the event.
*/
public bool ClickShortcutCheck(EventModifiers em, pb_Object pb, pb_Face quad)
{
if(pb_UV_Editor.instance == null)
{
if(em == (EventModifiers.Control | EventModifiers.Shift))
{
pbUndo.RecordObject(pb, "Quick Apply NoDraw");
pb.SetFaceMaterial(quad, queuedMaterial);
OnFaceChanged(pb);
pb_Editor_Utility.ShowNotification("Quick Apply Material");
return true;
}
}
return false;
}
示例2: ApplyMaterial
public void ApplyMaterial(pb_Object pb, pb_Face quad, Material mat)
{
if(mat == null)
return;
pbUndo.RecordObject(pb, "Apply Material + " + mat.name);
if(mat)
pb.SetFaceMaterial(quad, mat);
pb.GenerateUV2(pb_Editor.show_NoDraw);
OnSelectionUpdate(selection);
OnFaceChanged( pb );
}
示例3: 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
// Copy the currently selected vertices in world space.
// World space so that we don't have to apply transforms
// to match the current selection.
Vector3[] verts = currentSelection.pb.VerticesInWorldSpace(currentSelection.face.distinctIndices);
// Now go through and move the verts we just grabbed out about .1m from the original face.
Vector3 normal = pb_Math.Normal(verts);
for(int i = 0; i < verts.Length; i++)
verts[i] += normal.normalized * .01f;
if(preview)
Destroy(preview.gameObject);
preview = pb_Object.CreateInstanceWithVerticesFaces(verts, new pb_Face[1]{face});
preview.SetFaceMaterial(preview.faces, previewMaterial);
preview.ToMesh();
preview.Refresh();
}
示例4: SetPreviewObject
private void SetPreviewObject(pb_Object pb, int[] indicesToCenterPivotOn)
{
pb.isSelectable = false;
initPreview = false;
bool prevTransform = false;
if(previewObject != null)
{
prevTransform = true;
RegisterPreviewObjectTransform();
}
DestroyPreviewObject();
previewObject = pb;
previewObject.SetName("Preview");
previewObject.SetFaceMaterial(previewObject.faces, previewMat);
if(pb_Preferences_Internal.GetBool(pb_Constant.pbForceGridPivot))
previewObject.CenterPivot(indicesToCenterPivotOn == null ? new int[1]{0} : indicesToCenterPivotOn);
if(prevTransform)
{
previewObject.transform.position = m_pos;
previewObject.transform.rotation = m_rot;
previewObject.transform.localScale = m_scale;
}
else
{
pb_Editor_Utility.ScreenCenter(previewObject.gameObject);
}
if(pbUtil.SharedSnapEnabled)
pb.transform.position = pbUtil.SnapValue(pb.transform.position, pbUtil.SharedSnapValue);
else
if(pb_Preferences_Internal.GetBool(pb_Constant.pbForceVertexPivot))
pb.transform.position = pbUtil.SnapValue(pb.transform.position, 1f);
Selection.activeTransform = pb.transform;
}