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


C# pb_Object.GenerateUV2方法代码示例

本文整理汇总了C#中pb_Object.GenerateUV2方法的典型用法代码示例。如果您正苦于以下问题:C# pb_Object.GenerateUV2方法的具体用法?C# pb_Object.GenerateUV2怎么用?C# pb_Object.GenerateUV2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pb_Object的用法示例。


在下文中一共展示了pb_Object.GenerateUV2方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例2: ConnectEdges

		private static bool ConnectEdges(pb_Object pb, pb_Edge[] edgesToConnect)
		{	
			int len = edgesToConnect.Length;
			List<EdgeConnection> splits = new List<EdgeConnection>();

			for(int i = 0; i < len; i++)
			{
				foreach(pb_Face face in pbMeshUtils.GetConnectedFaces(pb, edgesToConnect[i]))
				{
					if(!splits.Contains((EdgeConnection)face))
					{
						List<pb_Edge> faceEdges = new List<pb_Edge>();
						foreach(pb_Edge e in edgesToConnect)
						{
							int localEdgeIndex = face.edges.IndexOf(e, pb.sharedIndices);
							if(localEdgeIndex > -1)
								faceEdges.Add(face.edges[localEdgeIndex]);
						}
	
						if(faceEdges.Count > 1)	
							splits.Add(new EdgeConnection(face, faceEdges));
					}
				}
			}

			pb_Face[] faces;
			if(pb.ConnectEdges(splits, out faces))
			{
				pb.SetSelectedFaces(faces);
				pb.GenerateUV2(true);
				pb.Refresh();
				return true;
			}
			return false;
		}
开发者ID:Wuzseen,项目名称:Vote-Or-Die,代码行数:35,代码来源:ConnectEdges.cs

示例3: InitObjectFlags

	/**
	 * \brief ProBuilder objects created in Editor need to be initialized with a number of additional Editor-only settings.
	 *	This method provides an easy method of doing so in a single call.  #InitObjectFlags will set the Entity Type, generate 
	 *	a UV2 channel, set the unwrapping parameters, and center the object in the screen. 
	 */
	public static void InitObjectFlags(pb_Object pb, ColliderType col, EntityType et)
	{
		switch(col)
		{
			case ColliderType.BoxCollider:
				pb.gameObject.AddComponent<BoxCollider>();
			break;

			case ColliderType.MeshCollider:
				pb.gameObject.AddComponent<MeshCollider>().convex = EditorPrefs.HasKey(pb_Constant.pbForceConvex) ? EditorPrefs.GetBool(pb_Constant.pbForceConvex) : false;
				break;
		}

		pb_Lightmap_Editor.SetObjectUnwrapParamsToDefault(pb);
		pb.GenerateUV2(true);
		pb_Editor_Utility.SetEntityType(et, pb.gameObject);
		pb_Editor_Utility.ScreenCenter( pb.gameObject );
	}
开发者ID:BasmanovDaniil,项目名称:RoyalDefenestrator,代码行数:23,代码来源:pb_Editor_Utility.cs


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