Example #1
0
 public void Update()
 {
     if (Input.GetKeyUp(KeyCode.Escape))   // back button pressed
     {
         var c = GetComponentInParent <Canvas>()?.rootCanvas;
         if (c != null && c == CanvasFinder.GetAllRootCanvases().First())
         {
             gameObject.GetComponentInParent <ViewStack>()?.SwitchBackToLastView(gameObject, destroyFinalView);
         }
     }
 }