private static void StartGrabbit(GrabbitMode mode = GrabbitMode.PLACE, bool ignoreChangeOfTool = false) { if (Instance.CurrentTool) { instance.CurrentTool.OnEnable(); } else { var grab = FindObjectOfType <GrabbitTool>(); if (!grab) { var tools = Resources.FindObjectsOfTypeAll <GrabbitTool>(); if (tools.Length > 0) { grab = tools[0]; } else { grab = CreateInstance <GrabbitTool>(); } } instance.CurrentTool = grab; instance.CurrentTool.OnEnable(); } if (!ignoreChangeOfTool) { if (instance.CurrentSettings.CurrentMode == GrabbitMode.SETTINGS) { instance.CurrentSettings.CurrentMode = GrabbitMode.PLACE; } CheckPauseMode(); } if (ToolManager.activeToolType == typeof(GrabbitTool)) { SceneView.lastActiveSceneView.Focus(); } else { ToolManager.SetActiveTool(instance.CurrentTool); } instance.Repaint(); SceneView.lastActiveSceneView.Focus(); instance.prefChanged = false; }
private static void StartGrabbitOnKeyDown(GrabbitMode mode = GrabbitMode.PLACE) { CreateInstanceIfNeeded(); if (!instance.PrepareSettings()) { return; } if (EditorApplication.isPlayingOrWillChangePlaymode && !instance.CurrentSettings.UseHotKeyInPlayMode) { return; } instance.CurrentSettings.CurrentMode = mode; instance.Focus(); StartGrabbit(mode); }
public static bool IsModePausedOnStart(GrabbitMode mode) { return(PausedOnStartModes.Contains(mode)); }