public void DisplayPreviousCanvas() { if (previousCanvas != null && previousCanvas != currentCanvas) { DisableAllCanvases(); previousCanvas.SetActive(true); currentCanvas = previousCanvas; OnScreenChangeEvent?.Invoke(); } }
public void DisplayCanvas(string canvasName) { previousCanvas = currentCanvas; DisableAllCanvases(); GameObject target = canvases.Find(i => i.name == canvasName); if (target != null) { target.SetActive(true); currentCanvas = target; OnScreenChangeEvent?.Invoke(); } else { Debug.LogError("Couldn't Find Canvas " + canvasName); } }