本文整理汇总了C#中pb_Object.SetName方法的典型用法代码示例。如果您正苦于以下问题:C# pb_Object.SetName方法的具体用法?C# pb_Object.SetName怎么用?C# pb_Object.SetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pb_Object
的用法示例。
在下文中一共展示了pb_Object.SetName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: 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;
}