-
Notifications
You must be signed in to change notification settings - Fork 340
Expand file tree
/
Copy pathTimeControlWindow.cs
More file actions
40 lines (36 loc) · 1.06 KB
/
TimeControlWindow.cs
File metadata and controls
40 lines (36 loc) · 1.06 KB
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
40
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace ToolKits
{
public class TimeControlWindow : EditorWindow
{
private static TimeControlWindow _window;
private static readonly Vector2 MIN_SIZE = new Vector2(400, 300);
private TimeControl _timeControl;
private static readonly Rect TIME_RECR = new Rect(20, 20, 300, 50);
[MenuItem("Tools/TimeControlWindow", priority = 10)]
private static void PopUp()
{
_window = GetWindow<TimeControlWindow>("TimeControlWindow");
_window.minSize = _window.maxSize = MIN_SIZE;
_window.Init();
_window.Show();
}
private void Init()
{
_timeControl = new TimeControl();
}
private void OnGUI()
{
_timeControl.DoTimeControl(TIME_RECR);
if (Event.current.type == EventType.Repaint)
{
_timeControl.Update();
}
Repaint();
}
}
}