Tanoda
UndoSelection.cs
Go to the documentation of this file.
1using UnityEngine;
2using System.Collections;
3using System.Linq;
4
5namespace GILES
6{
10 public class UndoSelection : IUndo
11 {
12 public UndoSelection() {}
13
14 public Hashtable RecordState()
15 {
16 Hashtable hash = new Hashtable();
17 int n = 0;
18
19 foreach(GameObject go in pb_Selection.gameObjects)
20 hash.Add(n++, go);
21
22 return hash;
23 }
24
25 public void ApplyState(Hashtable hash)
26 {
27 pb_Selection.SetSelection(hash.Values.Cast<GameObject>().ToList());
28 }
29
30 public void OnExitScope() {}
31 }
32}
void ApplyState(Hashtable hash)
Hashtable RecordState()
static List< GameObject > gameObjects
A list of the currently selected GameObjects.
Definition: pb_Selection.cs:56
static void SetSelection(IEnumerable< GameObject > selection)
Definition: pb_Selection.cs:92