本文整理汇总了C#中pb_Object.Optimize方法的典型用法代码示例。如果您正苦于以下问题:C# pb_Object.Optimize方法的具体用法?C# pb_Object.Optimize怎么用?C# pb_Object.Optimize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pb_Object
的用法示例。
在下文中一共展示了pb_Object.Optimize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
// }
}
示例2: 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;
}