void EndGame(bool success)
 {
     if (!success)
     {
         foreach (var n in spawnedNotes)
         {
             Destroy(n.gameObject);
         }
     }
     isGameRunning = false;
     root.SetActive(false);
     callback(success);
     WorldTime.Resume();
     DeFocusMe();
 }
Beispiel #2
0
    public override void OnLoseFocus()
    {
        WorldTime.Resume();
        invWindow.SetActive(false);
        Transform[] childs = itemTextRoot.gameObject.GetComponentsInChildren <Transform>();
        foreach (var c in childs)
        {
            if (c != itemTextRoot)
            {
                Destroy(c.gameObject);
            }
        }

        childs = craftTextRoot.gameObject.GetComponentsInChildren <Transform>();
        foreach (var c in childs)
        {
            if (c != craftTextRoot)
            {
                Destroy(c.gameObject);
            }
        }
        isWindowOpen = false;
    }