public void undoo() { if (sizeThing != null) { sizeThing.addCurrent(); } else if (sizeThing == null && GameObject.Find("sizeStuff(Clone)")) { sizeThing = GameObject.Find("sizeStuff(Clone)").GetComponent <sizeThing>(); sizeThing.addCurrent(); } int howMuch = 0; if (!reddo) { howMuch++; } if (history[HisPos + howMuch - 1].whatToDo == 0 || history[HisPos + howMuch - 1].whatToDo == 14) { HisPos++; } reddo = true; howMuch -= 2; if (HisPos + howMuch == 0) { undoB.SetActive(false); } blub(HisPos + howMuch); redoB.SetActive(true); }
public void redo() { if (sizeThing != null) { sizeThing.addCurrent(); } else if (sizeThing == null && GameObject.Find("sizeStuff(Clone)")) { sizeThing = GameObject.Find("sizeStuff(Clone)").GetComponent <sizeThing>(); sizeThing.addCurrent(); } int howMuch = 0; if (reddo) { howMuch--; } if (history[HisPos + howMuch + 1].whatToDo == 0 || history[HisPos + howMuch + 1].whatToDo == 14) { howMuch--; } reddo = false; howMuch += 2; if (HisPos + howMuch >= history.Count - 1) { redoB.SetActive(false); } undoB.SetActive(true); blub(HisPos + howMuch); }