forked from XINCGer/UnityToolchainsTrick
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ToolsAPI.cs
39 lines (35 loc) · 992 Bytes
/
ToolsAPI.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace ToolKits
{
public class ToolsAPI : EditorWindow
{
private static ViewTool _viewTool;
[MenuItem("Tools/ToolsAPI", priority = 22)]
private static void PopUp()
{
var _window = GetWindow<ToolsAPI>("ToolsAPI");
SceneView.duringSceneGui -= OnSceneViewGUI;
SceneView.duringSceneGui += OnSceneViewGUI;
_window.Show();
}
private void OnGUI()
{
if (GUILayout.Button("Tools.current"))
{
Debug.Log("Tools.current:" + Tools.current);
}
}
private static void OnSceneViewGUI(SceneView view)
{
if (Tools.viewTool != _viewTool)
{
Debug.Log("Tools.viewTool:" + Tools.viewTool);
_viewTool = Tools.viewTool;
}
}
}
}