本文整理汇总了C#中pb_Object.RefreshUV方法的典型用法代码示例。如果您正苦于以下问题:C# pb_Object.RefreshUV方法的具体用法?C# pb_Object.RefreshUV怎么用?C# pb_Object.RefreshUV使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pb_Object
的用法示例。
在下文中一共展示了pb_Object.RefreshUV方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TextureGroupSelectedFaces
private void TextureGroupSelectedFaces(pb_Object pb)//, pb_Face face)
{
if(pb.SelectedFaces.Length < 1) return;
pb_UV cont_uv = pb.SelectedFaces[0].uv;
int texGroup = pb.UnusedTextureGroup();
foreach(pb_Face f in pb.SelectedFaces)
{
f.SetUV( new pb_UV(cont_uv) );
f.textureGroup = texGroup;
}
pb.RefreshUV(pb.SelectedFaces);
SceneView.RepaintAll();
}
示例2: SetAutoUV
/**
* Sets the passed faces to use Auto or Manual UVs, and (if previously manual) splits any vertex connections.
*/
public static void SetAutoUV(pb_Object pb, pb_Face[] faces, bool auto)
{
if(auto)
{
faces = System.Array.FindAll(faces, x => x.manualUV).ToArray(); // only operate on faces that were previously manual
pb.SplitUVs( pb_Face.AllTriangles(faces) );
Vector2[][] uv_origins = new Vector2[faces.Length][];
for(int i = 0; i < faces.Length; i++)
uv_origins[i] = pb.GetUVs(faces[i].distinctIndices);
for(int f = 0; f < faces.Length; f++)
{
faces[f].uv.Reset();
faces[f].manualUV = !auto;
faces[f].elementGroup = -1;
}
pb.RefreshUV(faces);
for(int i = 0; i < faces.Length; i++)
{
pb_Transform2D transform = MatchCoordinates(pb.GetUVs(faces[i].distinctIndices), uv_origins[i]);
faces[i].uv.offset = -transform.position;
faces[i].uv.rotation = transform.rotation;
if( Mathf.Abs(transform.scale.sqrMagnitude - 2f) > .1f )
faces[i].uv.scale = transform.scale;
}
}
else
{
foreach(pb_Face f in faces)
{
f.textureGroup = -1;
f.manualUV = !auto;
}
}
}