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


C# pb_Object.RefreshUV方法代码示例

本文整理汇总了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();
	}
开发者ID:BasmanovDaniil,项目名称:RoyalDefenestrator,代码行数:17,代码来源:pb_Texture_Editor.cs

示例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;
			}
		}
	}
开发者ID:itubeasts,项目名称:I-eaT-U,代码行数:44,代码来源:pbUVOps.cs


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