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


C# pb_Object.Refresh方法代码示例

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


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

示例1: Start

		void Start()
		{
			// Create a new ProBuilder cube to work with.
			pb = pb_ShapeGenerator.CubeGenerator(Vector3.one);

			// Cycle through each unique vertex in the cube (8 total), and assign a color
			// to the index in the sharedIndices array.
			int si_len = pb.sharedIndices.Length;
			Color[] vertexColors = new Color[si_len];
			for(int i = 0; i < si_len; i++)
			{
				vertexColors[i] = HSVtoRGB( (i/(float)si_len) * 360f, 1f, 1f);
			}

			// Now go through each face (vertex colors are stored the pb_Face class) and
			// assign the pre-calculated index color to each index in the triangles array.
			Color[] colors = pb.colors;

			for(int CurSharedIndex = 0; CurSharedIndex < pb.sharedIndices.Length; CurSharedIndex++)
			{
				foreach(int CurIndex in pb.sharedIndices[CurSharedIndex].array)
				{
					colors[CurIndex] = vertexColors[CurSharedIndex];
				}
			}

			pb.SetColors(colors);

			// In order for these changes to take effect, you must refresh the mesh
			// object.
			pb.Refresh();
		}
开发者ID:ChetahPangestu,项目名称:MajorProjectReveal,代码行数:32,代码来源:HueCube.cs

示例2: Start

	void Start()
	{
		// Create a new ProBuilder cube to work with.
		pb = ProBuilder.CreatePrimitive(Shape.Cube);
	
		// Because of the way colors are stored (one color per-index in triangle array),
		// we have to keep track of what color belongs to what index.  A real pain, I am
		// aware.  This will be changed in the future - because it is a terrible method.
		Dictionary<int, Color32> vertexColors = new Dictionary<int, Color32>();

		// Cycle through each unique vertex in the cube (8 total), and assign a color
		// to the index in the sharedIndices array.
		int si_len = pb.sharedIndices.Length;
		for(int i = 0; i < si_len; i++)
		{
			vertexColors.Add(i, HSVtoRGB( (i/(float)si_len) * 360f, 1f, 1f) );
		}

		// Now go through each face (vertex colors are stored the pb_Face class) and
		// assign the pre-calculated index color to each index in the triangles array.
		foreach(pb_Face face in pb.faces)
		{
			Color32[] faceColors = new Color32[face.indices.Length];
			for(int i = 0; i < face.indices.Length; i++)
			{
				int index = pb.sharedIndices.IndexOf(face.indices[i]);
				faceColors[i] = vertexColors[index];
			}
			face.SetColors(faceColors);
		}

		// In order for these changes to take effect, you must refresh the mesh
		// object.
		pb.Refresh();
	}
开发者ID:benlewis,项目名称:unhinged_vr,代码行数:35,代码来源:HueCube.cs

示例3: SetPivot

    private static void SetPivot(pb_Object pbo, int[] testIndices, bool doSnap)
    {
        Vector3 center = Vector3.zero;
        foreach (Vector3 vector in pbo.VerticesInWorldSpace(testIndices))
        {
            center += vector;
        }
        center /= testIndices.Length;
            
        if(doSnap)
            center = pbUtil.SnapValue(center, Vector3.one, SixBySeven.Shared.snapValue);

        Vector3 dir = (pbo.transform.position - center);

        pbo.transform.position = center;

        // the last bool param force disables snapping vertices
        pbo.TranslateVertices(pbo.uniqueIndices, dir, true);
		
		pbo.Refresh();
    }
开发者ID:Izzu,项目名称:Hearthstone-RTS,代码行数:21,代码来源:PivotTool.cs

示例4: OnSceneGUI

	void OnSceneGUI(SceneView scnview)
	{
		if(!enabled)// || (EditorWindow.focusedWindow != scnview && !lockhandleToCenter))
			return;

		if(editor && editor.editLevel != EditLevel.Plugin)
			editor.SetEditLevel(EditLevel.Plugin);
 
// #if UNITY_5
// 		if( Lightmapping.giWorkflowMode == Lightmapping.GIWorkflowMode.Iterative )
// 		{
// 			pb_Lightmapping.PushGIWorkflowMode();
// 			Lightmapping.Cancel();
// 			Debug.LogWarning("Vertex Painter requires Continuous Baking to be Off.  When you close the Vertex Painter tool, Continuous Baking will returned to it's previous state automatically.\nIf you toggle Continuous Baking On while the Vertex Painter is open, you may lose all mesh vertex colors.");
// 		}
// #endif

		currentEvent = Event.current;
		sceneCamera = scnview.camera;

		screenCenter.x = Screen.width/2f;
		screenCenter.y = Screen.height/2f;

		mouseMoveEvent = currentEvent.type == EventType.MouseMove;
		
		/**
		 * Check if a new object is under the mouse.
		 */
		if( mouseMoveEvent )
		{
			GameObject go = HandleUtility.PickGameObject(Event.current.mousePosition, false);

			if( go != null && (pb == null || go != pb.gameObject) )
			{
				pb = go.GetComponent<pb_Object>();

				if(pb != null)
				{
					textures = GetTextures( pb.transform.GetComponent<MeshRenderer>().sharedMaterial ).ToArray();
					Repaint();

					modified.Add(pb);
					
					pb.ToMesh();
					pb.Refresh();
				}
			}
		}

		/**
		 * Hit test scene
		 */
		if(!lockhandleToCenter && !pb_Handle_Utility.SceneViewInUse(currentEvent))
		{
			if(pb != null)
			{
				if(!hovering.ContainsKey(pb))
				{
					hovering.Add(pb, pb.colors ?? new Color[pb.vertexCount]);
				}
				else
				{
					if(pb.msh.vertexCount != pb.vertexCount)
					{
						// script reload can make this happen
						pb.ToMesh();
						pb.Refresh();
					}

					pb.msh.colors = hovering[pb];
				}
 
				Ray ray = HandleUtility.GUIPointToWorldRay(currentEvent.mousePosition);
				pb_RaycastHit hit;

				if ( pb_Handle_Utility.MeshRaycast(ray, pb, out hit) )
				{
					handlePosition = pb.transform.TransformPoint(hit.Point);
					handleDistance = Vector3.Distance(handlePosition, sceneCamera.transform.position);					
					handleRotation = Quaternion.LookRotation(nonzero(pb.transform.TransformDirection(hit.Normal)), Vector3.up);
 
					Color[] colors = pb.msh.colors;

					int[][] sharedIndices = pb.sharedIndices.ToArray();

					// wrapped in try/catch because a script reload can cause the mesh
					// to re-unwrap itself in some crazy configuration, throwing off the 
					// vertex count sync.
					try
					{
						for(int i = 0; i < sharedIndices.Length; i++)
						{
							float dist = Vector3.Distance(hit.Point, pb.vertices[sharedIndices[i][0]]);

							if(dist < brushSize)
							{
								for(int n = 0; n < sharedIndices[i].Length; n++)
								{
									colors[sharedIndices[i][n]] = Lerp(hovering[pb][sharedIndices[i][n]], color, (1f-(dist/brushSize)) * brushOpacity );
								}
//.........这里部分代码省略.........
开发者ID:itubeasts,项目名称:I-eaT-U,代码行数:101,代码来源:pb_Vertex_Color_Painter.cs

示例5: Start

		/**
		 * Creates the icosphere, and loads all the cache information.
		 */
		void Start()
		{
			audioSource = GetComponent<AudioSource>();

			if( audioSource.clip == null )
				missingClipWarning.SetActive(true);

			// Create a new icosphere.
			ico = pb_ShapeGenerator.IcosahedronGenerator(icoRadius, icoSubdivisions);

			// Shell is all the faces on the new icosphere.
			pb_Face[] shell = ico.faces;
				
			// Materials are set per-face on pb_Object meshes.  pb_Objects will automatically
			// condense the mesh to the smallest set of subMeshes possible based on materials.
			foreach(pb_Face f in shell)
				f.SetMaterial( material );

			pb_Face[] connectingFaces;

			// Extrude all faces on the icosphere by a small amount.  The third boolean parameter
			// specifies that extrusion should treat each face as an individual, not try to group
			// all faces together.
			ico.Extrude(shell, startingExtrusion, false, out connectingFaces);

			// ToMesh builds the mesh positions, submesh, and triangle arrays.  Call after adding
			// or deleting vertices, or changing face properties.
			ico.ToMesh();

			// Refresh builds the normals, tangents, and UVs.
			ico.Refresh();

			outsides = new FaceRef[shell.Length];
			Dictionary<int, int> lookup = ico.sharedIndices.ToDictionary();

			// Populate the outsides[] cache.  This is a reference to the tops of each extruded column, including
			// copies of the sharedIndices.
			for(int i = 0; i < shell.Length; ++i)
				outsides[i] = new FaceRef( 	shell[i],
											pb_Math.Normal(ico, shell[i]),
											ico.sharedIndices.AllIndicesWithValues(lookup, shell[i].distinctIndices).ToArray()
											);

			// Store copy of positions array un-modified
			original_vertices = new Vector3[ico.vertices.Length];
			System.Array.Copy(ico.vertices, original_vertices, ico.vertices.Length);

			// displaced_vertices should mirror icosphere mesh vertices.
			displaced_vertices = ico.vertices;

			icoMesh = ico.msh;
			icoTransform = ico.transform;

			faces_length = (float)outsides.Length;

			// Build the waveform ring.
			icoPosition = icoTransform.position;
			waveform.SetVertexCount(WAVEFORM_SAMPLES);

			if( bounceWaveform )
				waveform.transform.parent = icoTransform;

			audioSource.Play();
		}
开发者ID:DannyBoyThomas,项目名称:Project-Z,代码行数:67,代码来源:IcoBumpin.cs

示例6: OnFaceChanged

		private static void OnFaceChanged( pb_Object pb )
		{
			pb.ToMesh();
			pb.Refresh();
			pb.Optimize();
			
			// StaticEditorFlags flags = GameObjectUtility.GetStaticEditorFlags( pb.gameObject );
			
			// // if nodraw not found, and entity type should be batching static
			// if(pb.GetComponent<pb_Entity>().entityType != EntityType.Mover)
			// {
			// 	flags = flags | StaticEditorFlags.BatchingStatic;
			// 	GameObjectUtility.SetStaticEditorFlags(pb.gameObject, flags);
			// }
		}
开发者ID:itubeasts,项目名称:I-eaT-U,代码行数:15,代码来源:pb_Material_Editor.cs

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

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

示例9: DetachFacesToObject

	/**
	 * Deletes @faces from the passed pb_Object, and creates a new pb_Object using @faces.  On success,
	 * detachedObject will be set to the new pb_Object.
	 * 
	 * NOTE - As of 2.3, `DetachFacesToObject` was not publicly available in the pbMeshOps.  This method
	 * was made available in 2.3.1 as an extension method to pb_Object:
	 * `pbMeshOps::DetachFacesToObject(this pb_Object pb, pb_Face[] faces, out pb_Object detachedObject)`
	 */
	static bool DetachFacesToObject(pb_Object pb, pb_Face[] faces, out pb_Object detachedObject)
	{
		detachedObject = null;

		if(faces.Length < 1 || faces.Length == pb.faces.Length)
			return false;

		int[] primary = new int[faces.Length];
		for(int i = 0; i < primary.Length; i++)
			primary[i] = System.Array.IndexOf(pb.faces, faces[i]);
		
		int[] inverse = new int[pb.faces.Length - primary.Length];
		int n = 0;

		for(int i = 0; i < pb.faces.Length; i++)
			if(System.Array.IndexOf(primary, i) < 0)
				inverse[n++] = i;
				
		detachedObject = pb_Object.InitWithObject(pb);

		detachedObject.transform.position = pb.transform.position;
		detachedObject.transform.localScale = pb.transform.localScale;
		detachedObject.transform.localRotation = pb.transform.localRotation;

		pb.DeleteFaces(primary);
		detachedObject.DeleteFaces(inverse);

		pb.ToMesh();
		detachedObject.ToMesh();

		pb.Refresh();
		detachedObject.Refresh();
	
		detachedObject.gameObject.name = pb.gameObject.name + "-detach";
		
		return true;
	}
开发者ID:karl-,项目名称:pipedreams,代码行数:45,代码来源:Pipe.cs

示例10: ProjectFacesBox

	/**
	 * Projects UVs for each face using the closest normal on a box.
	 */
	public  static void ProjectFacesBox(pb_Object pb, pb_Face[] faces)
	{
		Vector2[] uv = pb.uv;

		Dictionary<ProjectionAxis, List<pb_Face>> sorted = new Dictionary<ProjectionAxis, List<pb_Face>>();

		for(int i = 0; i < faces.Length; i++)
		{
			Vector3 nrm = pb_Math.Normal(pb, faces[i]);
			ProjectionAxis axis = pb_Math.VectorToProjectionAxis(nrm);

			if(sorted.ContainsKey(axis))
			{
				sorted[axis].Add(faces[i]);
			}
			else
			{
				sorted.Add(axis, new List<pb_Face>() { faces[i] });
			}

			// clean up UV stuff - no shared UV indices and remove element group
			faces[i].elementGroup = -1;
		}

		foreach(KeyValuePair<ProjectionAxis, List<pb_Face>> kvp in sorted)
		{
			int[] distinct = pb_Face.AllTrianglesDistinct(kvp.Value.ToArray());

			Vector2[] uvs = pb_Math.PlanarProject( pb.GetVertices(distinct), pb_Math.ProjectionAxisToVector(kvp.Key), kvp.Key );

			for(int n = 0; n < distinct.Length; n++)
				uv[distinct[n]] = uvs[n];
				
			SplitUVs(pb, distinct);
		}

		/* and set the msh uv array using the new coordintaes */
		pb.SetUV(uv);
		
		pb.ToMesh();
		pb.Refresh();
	}
开发者ID:itubeasts,项目名称:I-eaT-U,代码行数:45,代码来源:pbUVOps.cs

示例11: FindDuplicateVertices

		/**
		 * Returns a jagged array of indices that share the same position, texture coordinate, and smoothing group.
		 * Must be called after Refresh() but before GenerateUV2().
		 */
		public static List<List<int>> FindDuplicateVertices(pb_Object pb)
		{
			Vector3[] normals = pb.msh.normals;

			if(pb.vertexCount != normals.Length)
			{
				pb.Refresh();
				normals = pb.msh.normals;
			}

			Color[] colors = pb.colors;
			Vector2[] textures = pb.uv;

			int[] smoothGroup = new int[normals.Length];

			/**
			 * Create a lookup of each triangles smoothing group.
			 */
			foreach(pb_Face face in pb.faces)
			{
				foreach(int tri in face.distinctIndices)
					smoothGroup[tri] = face.smoothingGroup;
			}

			List<int> list;
			List<List<int>> merge = new List<List<int>>();

			/**
			 * For each sharedIndices group (individual vertex), find vertices that are in the same smoothing
			 * group and check if their texture coordinates are similar enough to collapse to a single vertex.
			 */
			for(int i = 0; i < pb.sharedIndices.Length; i++)
			{
				Dictionary<int, List<int>> shareable = new Dictionary<int, List<int>>();

				/**
				 * Sort indices that share a smoothing group
				 */
				foreach(int tri in pb.sharedIndices[i].array)
				{
					if(smoothGroup[tri] > 24)	
						continue;

					if( shareable.TryGetValue(smoothGroup[tri], out list) )
						list.Add(tri);
					else
						shareable.Add(smoothGroup[tri], new List<int>() { tri });
				}

				/**
				 * At this point, `shareable` contains a key value pair of 
				 * { SmoothingGroupKey, All valid triangles pointing to this vertex }
				 */

				/**
				 * Now go through each key value pair and sort them into vertices that
				 * share a 'close enough' texture coordinate to be considered the same.
				 * Don't bother checking position since if they're in the same shared
				 * index group that should always means they're on top of one-another.
				 */

				foreach(KeyValuePair<int, List<int>> group in shareable)
				{			
					List<List<int>> matches = new List<List<int>>();

					foreach(int tri in group.Value)
					{
						bool foundMatch = false;

						for(int n = 0; n < matches.Count; n++)
						{
							if( textures[matches[n][0]].Approx(textures[tri], .001f) &&
								normals[matches[n][0]].Approx(normals[tri], .001f) &&
								(colors == null || colors[matches[n][0]].Approx(colors[tri], .001f)))
							{
								matches[n].Add(tri);
								foundMatch = true;
								break;
							}
						}

						if(!foundMatch)
							matches.Add( new List<int>() { tri } );
					}
	
					merge.AddRange( matches.Where(x => x.Count > 1) );
				}
			}

			return merge;
		}
开发者ID:itubeasts,项目名称:I-eaT-U,代码行数:95,代码来源:pb_MeshUtility.cs

示例12: ClickShortcutCheck

	/**
	 * return true if shortcut should eat the event
	 */
	internal bool ClickShortcutCheck(pb_Object pb, pb_Face selectedFace)
	{
		Event e = Event.current;

		// Copy UV settings
		if(e.modifiers == (EventModifiers.Control | EventModifiers.Shift))
		{
			// get first selected Auto UV face
			pb_Object firstObj;
			pb_Face source;

			pb_Editor.instance.GetFirstSelectedFace(out firstObj, out source);

			if( source != null )
			{
				pbUndo.RecordObject(pb, "Copy UV Settings");

				selectedFace.SetUV( new pb_UV(source.uv) );
				selectedFace.SetMaterial( source.material );
				pb_Editor_Utility.ShowNotification("Copy UV Settings");

				pb.ToMesh();
				pb.Refresh();
				pb.Optimize();
				
				RefreshUVCoordinates();

				Repaint();
				
				return true;
			}
			else
			{
				return false;
			}
		}
		else
		if(e.modifiers == EventModifiers.Control)
		{
			int len = pb.SelectedFaces == null ? 0 : pb.SelectedFaces.Length;

			if(len < 1)
				return false;

			pb_Face anchor = pb.SelectedFaces[len-1];

			if(anchor == selectedFace) return false;

			pbUndo.RecordObject(pb, "AutoStitch");

			pb.ToMesh();

			bool success = pbUVOps.AutoStitch(pb, anchor, selectedFace);
			
			if(success)
			{	
				RefreshElementGroups(pb);

				pb.SetSelectedFaces(new pb_Face[]{selectedFace});

				// // only need to do this for one pb_Object...
				// for(int i = 0; i < selection.Length; i++)
				// 	selection[i].RefreshUV( editor.SelectedFacesInEditZone[i] );

				pb.Refresh();
				pb.Optimize();

				SetSelectedUVsWithSceneView();

				RefreshUVCoordinates();

				pb_Editor_Utility.ShowNotification("Autostitch");

				if(editor != null)
					editor.UpdateSelection(false);

				Repaint();
			}
			else
			{
				pb.Refresh();
				pb.Optimize();
			}

			return success;
		}

		return false;
	}
开发者ID:itubeasts,项目名称:I-eaT-U,代码行数:92,代码来源:pb_UV_Editor.cs

示例13: CombineObjects

	/**
	 *	\brief Given an array of "donors", this method returns a merged #pb_Object.
	 */
	 public static bool CombineObjects(pb_Object[] pbs, out pb_Object combined)
	 {
	 	combined = null;

	 	if(pbs.Length < 1) return false;

	 	List<Vector3> v = new List<Vector3>();
	 	List<Vector2> u = new List<Vector2>();
	 	List<Color> c = new List<Color>();
	 	List<pb_Face> f = new List<pb_Face>();
	 	List<pb_IntArray> s = new List<pb_IntArray>();
	 	List<pb_IntArray> suv = new List<pb_IntArray>();

	 	foreach(pb_Object pb in pbs)
	 	{
	 		int vertexCount = v.Count;

	 		// Vertices
	 		v.AddRange(pb.VerticesInWorldSpace());

	 		// UVs
	 		u.AddRange(pb.uv);

	 		// Colors
	 		c.AddRange(pb.colors);

			// Faces
	 		pb_Face[] faces = new pb_Face[pb.faces.Length];
	 		for(int i = 0; i < faces.Length; i++)
	 		{
	 			faces[i] = new pb_Face(pb.faces[i]);
	 			faces[i].manualUV = true;
	 			faces[i].ShiftIndices(vertexCount);
	 			faces[i].RebuildCaches();
	 		}
	 		f.AddRange(faces);

	 		// Shared Indices
	 		pb_IntArray[] si = pb.GetSharedIndices();
	 		for(int i = 0; i < si.Length; i++)
	 		{
	 			for(int n = 0; n < si[i].Length; n++)
	 				si[i][n] += vertexCount;
	 		}
	 		s.AddRange(si);

	 		// Shared Indices UV
	 		{
		 		pb_IntArray[] si_uv = pb.GetSharedIndicesUV();
		 		for(int i = 0; i < si_uv.Length; i++)
		 		{
		 			for(int n = 0; n < si_uv[i].Length; n++)
		 				si_uv[i][n] += vertexCount;
		 		}

		 		suv.AddRange(si_uv);
		 	}
	 	}

		GameObject go = (GameObject)GameObject.Instantiate(pbs[0].gameObject);
	 	go.transform.position = Vector3.zero;
	 	go.transform.localRotation = Quaternion.identity;
	 	go.transform.localScale = Vector3.one;

	 	// Destroy the children
	 	foreach(Transform t in go.transform)
	 		GameObject.DestroyImmediate(t.gameObject);

	 	if(go.GetComponent<pb_Object>()) GameObject.DestroyImmediate(go.GetComponent<pb_Object>());
	 	if(go.GetComponent<pb_Entity>()) GameObject.DestroyImmediate(go.GetComponent<pb_Entity>());

	 	combined = go.AddComponent<pb_Object>();

		combined.SetVertices(v.ToArray());
		combined.SetUV(u.ToArray());
		combined.SetColors(c.ToArray());
		combined.SetFaces(f.ToArray());

		combined.SetSharedIndices( s.ToArray() ?? pb_IntArrayUtility.ExtractSharedIndices(v.ToArray()) );
		combined.SetSharedIndicesUV( suv.ToArray() ?? new pb_IntArray[0] {});

		combined.ToMesh();

		combined.GetComponent<pb_Entity>().SetEntity( pbs[0].GetComponent<pb_Entity>().entityType );
	 	
	 	combined.CenterPivot( pbs[0].transform.position );

		combined.Refresh();

		// refresh donors since deleting the children of the instantiated object could cause them to lose references
		foreach(pb_Object pb in pbs)
			pb.Verify();

	 	return true;
	 }
开发者ID:itubeasts,项目名称:I-eaT-U,代码行数:98,代码来源:pbMeshOps.cs


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