当前位置: 首页>>代码示例>>C#>>正文


C# pb_Object.SetName方法代码示例

本文整理汇总了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);
	}
开发者ID:GDxU,项目名称:incomplete-richman,代码行数:24,代码来源:RuntimeEdit.cs

示例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;
	}
开发者ID:BasmanovDaniil,项目名称:RoyalDefenestrator,代码行数:41,代码来源:pb_Geometry_Interface.cs


注:本文中的pb_Object.SetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。