Tanoda
pb_UndoButton.cs
Go to the documentation of this file.
1using UnityEngine;
2using UnityEngine.UI;
3using System.Collections;
4
5namespace GILES
6{
8 {
9 public override string tooltip
10 {
11 get
12 {
13 string cur = Undo.GetCurrentUndo();
14
15 if(string.IsNullOrEmpty(cur))
16 return /*Macro.T*/("");
17 else
18 return /*Macro.T*/("") + ": " + cur;
19 }
20 }
21
22 protected override void Start()
23 {
24 base.Start();
25
26 if(Undo.instance.undoStackModified != null)
27 Undo.instance.undoStackModified += UndoStackModified;
28 else
29 Undo.instance.undoStackModified = UndoStackModified;
30
33
34 UndoStackModified();
35 }
36
37 public void DoUndo()
38 {
40 }
41
42 private void UndoStackModified()
43 {
44 interactable = !string.IsNullOrEmpty(Undo.GetCurrentUndo());
45 }
46 }
47}
static void PerformUndo()
Definition: Undo.cs:237
static string GetCurrentUndo()
Definition: Undo.cs:196
static void AddOnLevelLoadedListener(Callback listener)
Definition: pb_Scene.cs:107
static void AddOnLevelClearedListener(Callback listener)
Definition: pb_Scene.cs:118
override void Start()
override string tooltip