Tanoda
UndoInstantiate.cs
Go to the documentation of this file.
1
using
UnityEngine
;
2
using
System.Collections;
3
using
System.Collections.Generic;
4
using
System.Linq;
5
6
namespace
GILES
7
{
11
public
class
UndoInstantiate
:
IUndo
12
{
13
public
GameObject
gameObject
;
14
[SerializeField]
bool
initialized =
false
;
15
16
public
UndoInstantiate
(GameObject go)
17
{
18
this.gameObject = go;
19
initialized =
false
;
20
}
21
22
public
Hashtable
RecordState
()
23
{
24
Hashtable hash =
new
Hashtable();
25
hash.Add(
gameObject
, initialized ?
gameObject
.activeSelf :
false
);
26
initialized =
true
;
27
HttpCookie.SetCookie(
"unsavedChanges"
,
"true"
,
""
,
"/"
,
""
,
""
);
28
return
hash;
29
}
30
31
public
void
ApplyState
(Hashtable hash)
32
{
33
foreach
(DictionaryEntry kvp
in
hash)
34
((GameObject)kvp.Key).SetActive((
bool
)kvp.Value);
35
}
36
37
public
void
OnExitScope
()
38
{
39
if
(
gameObject
!=
null
&& !
gameObject
.activeSelf )
40
pb_ObjectUtility.Destroy(
gameObject
);
41
}
42
}
43
}
GILES.UndoInstantiate
Definition:
UndoInstantiate.cs:12
GILES.UndoInstantiate.ApplyState
void ApplyState(Hashtable hash)
Definition:
UndoInstantiate.cs:31
GILES.UndoInstantiate.RecordState
Hashtable RecordState()
Definition:
UndoInstantiate.cs:22
GILES.UndoInstantiate.UndoInstantiate
UndoInstantiate(GameObject go)
Definition:
UndoInstantiate.cs:16
GILES.UndoInstantiate.gameObject
GameObject gameObject
Definition:
UndoInstantiate.cs:13
GILES.UndoInstantiate.OnExitScope
void OnExitScope()
Definition:
UndoInstantiate.cs:37
GILES.IUndo
Definition:
IUndo.cs:10
GILES
Definition:
pb_CollectionUtil.cs:4
UnityEngine
Definition:
HSVPicker/UtilityScripts/BoxSlider.cs:7
Source
Assets
GILES
Code
Classes
Undo
UndoInstantiate.cs
Generated by
1.9.3