Tanoda
pb_RedoButton.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.GetCurrentRedo();
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 += RedoStackModified;
28 else
29 Undo.instance.undoStackModified = RedoStackModified;
30
31 if(Undo.instance.redoStackModified != null)
32 Undo.instance.redoStackModified += RedoStackModified;
33 else
34 Undo.instance.redoStackModified = RedoStackModified;
35
38
39 RedoStackModified();
40 }
41
42 public void DoRedo()
43 {
45 }
46
47 private void RedoStackModified()
48 {
49 interactable = !string.IsNullOrEmpty(Undo.GetCurrentRedo());
50 }
51 }
52}
static string GetCurrentRedo()
Definition: Undo.cs:204
static void PerformRedo()
Definition: Undo.cs:259
override void Start()
override string tooltip
static void AddOnLevelLoadedListener(Callback listener)
Definition: pb_Scene.cs:107
static void AddOnLevelClearedListener(Callback listener)
Definition: pb_Scene.cs:118