本文整理匯總了C#中UnityEditor.SceneView.Focus方法的典型用法代碼示例。如果您正苦於以下問題:C# SceneView.Focus方法的具體用法?C# SceneView.Focus怎麽用?C# SceneView.Focus使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UnityEditor.SceneView
的用法示例。
在下文中一共展示了SceneView.Focus方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: HandleMouseDown
private static void HandleMouseDown(SceneView view, int id, int button)
{
SceneViewMotion.s_Dragged = false;
if (!Tools.viewToolActive)
return;
ViewTool viewTool = Tools.viewTool;
if (Tools.s_LockedViewTool == viewTool)
return;
Event current = Event.current;
GUIUtility.hotControl = id;
Tools.s_LockedViewTool = viewTool;
SceneViewMotion.s_StartZoom = view.size;
SceneViewMotion.s_ZoomSpeed = Mathf.Max(Mathf.Abs(SceneViewMotion.s_StartZoom), 0.3f);
SceneViewMotion.s_TotalMotion = 0.0f;
if ((bool) ((Object) view))
view.Focus();
if ((bool) ((Object) Toolbar.get))
Toolbar.get.Repaint();
EditorGUIUtility.SetWantsMouseJumping(1);
current.Use();
GUIUtility.ExitGUI();
}
示例2: HandleMouseDown
private static void HandleMouseDown(SceneView view, int id, int button)
{
s_Dragged = false;
if (Tools.viewToolActive)
{
ViewTool viewTool = Tools.viewTool;
if (Tools.s_LockedViewTool != viewTool)
{
Event current = Event.current;
GUIUtility.hotControl = id;
Tools.s_LockedViewTool = viewTool;
s_StartZoom = view.size;
s_ZoomSpeed = Mathf.Max(Mathf.Abs(s_StartZoom), 0.3f);
s_TotalMotion = 0f;
if (view != null)
{
view.Focus();
}
if (Toolbar.get != null)
{
Toolbar.get.Repaint();
}
EditorGUIUtility.SetWantsMouseJumping(1);
current.Use();
GUIUtility.ExitGUI();
}
}
}