當前位置: 首頁>>代碼示例>>C#>>正文


C# SceneView.Focus方法代碼示例

本文整理匯總了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();
 }
開發者ID:BlakeTriana,項目名稱:unity-decompiled,代碼行數:22,代碼來源:SceneViewMotion.cs

示例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();
         }
     }
 }
開發者ID:CarlosHBC,項目名稱:UnityDecompiled,代碼行數:28,代碼來源:SceneViewMotion.cs


注:本文中的UnityEditor.SceneView.Focus方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。