本文整理汇总了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 );
}
示例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;
}
示例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 );
}