forked from Unity-Technologies/UnityCsReference
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnimationWindowKeySelection.cs
More file actions
42 lines (36 loc) · 1.21 KB
/
Copy pathAnimationWindowKeySelection.cs
File metadata and controls
42 lines (36 loc) · 1.21 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
41
42
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
using System;
using System.Linq;
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.Collections;
using Object = UnityEngine.Object;
namespace UnityEditorInternal
{
[System.Serializable]
internal class AnimationWindowKeySelection : ScriptableObject, ISerializationCallbackReceiver
{
private HashSet<int> m_SelectedKeyHashes;
[SerializeField] private List<int> m_SelectedKeyHashesSerialized;
public HashSet<int> selectedKeyHashes
{
get { return m_SelectedKeyHashes ?? (m_SelectedKeyHashes = new HashSet<int>()); }
set { m_SelectedKeyHashes = value; }
}
public void SaveSelection(string undoLabel)
{
Undo.RegisterCompleteObjectUndo(this, undoLabel);
}
public void OnBeforeSerialize()
{
m_SelectedKeyHashesSerialized = m_SelectedKeyHashes.ToList();
}
public void OnAfterDeserialize()
{
m_SelectedKeyHashes = new HashSet<int>(m_SelectedKeyHashesSerialized);
}
}
}