-
Notifications
You must be signed in to change notification settings - Fork 306
/
InputUpdateType.cs
46 lines (41 loc) · 1.16 KB
/
InputUpdateType.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
40
41
42
43
44
45
46
using System;
namespace UnityEngine.Experimental.Input
{
[Flags]
public enum InputUpdateType
{
None = 0,
Dynamic = 1 << 0,
Fixed = 1 << 1,
BeforeRender = 1 << 2,
Editor = 1 << 3
}
internal static class InputUpdate
{
public static InputUpdateType lastUpdateType;
public static uint dynamicUpdateCount;
public static uint fixedUpdateCount;
[Serializable]
public struct SerializedState
{
public InputUpdateType lastUpdateType;
public uint dynamicUpdateCount;
public uint fixedUpdateCount;
}
public static SerializedState Save()
{
return new SerializedState
{
lastUpdateType = lastUpdateType,
dynamicUpdateCount = dynamicUpdateCount,
fixedUpdateCount = fixedUpdateCount,
};
}
public static void Restore(SerializedState state)
{
lastUpdateType = state.lastUpdateType;
dynamicUpdateCount = state.dynamicUpdateCount;
fixedUpdateCount = state.fixedUpdateCount;
}
}
}