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


C# pb_Object.SetFaceMaterial方法代码示例

本文整理汇总了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;
		}
开发者ID:itubeasts,项目名称:I-eaT-U,代码行数:19,代码来源:pb_Material_Editor.cs

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

示例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();
		}
开发者ID:Desasterrus,项目名称:HSE_project_1st_year_game,代码行数:24,代码来源:RuntimeEdit.cs

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


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