A game about forced loneliness, made by TACStudios
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using UnityEngine;
5
6namespace UnityEditor.Graphing
7{
8 [Serializable]
9 class GraphDrawingData : ISerializationCallbackReceiver
10 {
11 [SerializeField]
12 private List<string> m_SerializableSelection = new List<string>();
13
14 [NonSerialized]
15 private List<Guid> m_Selection = new List<Guid>();
16
17 public IEnumerable<Guid> selection
18 {
19 get { return m_Selection; }
20 set
21 {
22 m_Selection.Clear();
23 m_Selection.AddRange(value);
24 }
25 }
26
27 public void OnBeforeSerialize()
28 {
29 m_SerializableSelection.Clear();
30 m_SerializableSelection.AddRange(m_Selection.Select(x => x.ToString()));
31 }
32
33 public void OnAfterDeserialize()
34 {
35 selection = m_SerializableSelection.Select(x => new Guid(x));
36 }
37 }
38}