Esempio n. 1
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(gameObject);
    }
Esempio n. 2
0
 // Displays the Credits Window in the Main Menu
 public void Credit()
 {
     if (CreditMenu.activeInHierarchy == false)
     {
         //closes other windows if open
         TutorialMenu.SetActive(false);
         HighscoreMenu.SetActive(false);
         //open credits
         CreditMenu.SetActive(true);
     }
     else
     {
         CreditMenu.SetActive(false);
     }
 }
Esempio n. 3
0
 // Displays the Tutorial Window in the Main Menu
 public void Tutorial()
 {
     if (TutorialMenu.activeInHierarchy == false)
     {
         //closes other windows if open
         CreditMenu.SetActive(false);
         HighscoreMenu.SetActive(false);
         //open tutorial
         TutorialMenu.SetActive(true);
     }
     else
     {
         TutorialMenu.SetActive(false);
     }
 }
Esempio n. 4
0
 // Displays the High Score Window in the Main Menu
 public void HighScore()
 {
     if (HighscoreMenu.activeInHierarchy == false)
     {
         //closes other windows if open
         CreditMenu.SetActive(false);
         TutorialMenu.SetActive(false);
         //open high scores
         HighscoreMenu.SetActive(true);
     }
     else
     {
         HighscoreMenu.SetActive(false);
     }
 }
    public void CloseMenu(TutorialMenu menu)
    {
        if (menuStack.Count == 0)
        {
            Debug.LogErrorFormat(menu, "{0} cannot be closed because menu stack is empty", menu.GetType());
            return;
        }

        if (menuStack.Peek() != menu)
        {
            Debug.LogErrorFormat(menu, "{0} cannot be closed because it is not on top of stack", menu.GetType());
            return;
        }

        CloseTopMenu();
    }
    public void OpenMenu(TutorialMenu instance)
    {
        if (menuStack.Contains(instance))
        {
            menuStack.Remove(instance);
        }

        // De-activate top menu
        if (menuStack.Count > 0)
        {
            CloseMenu(menuStack.ElementAt(0));
        }

        menuStack.Push(instance);

        instance.transform.position = vrCamera.position + vrCamera.forward * distanceToCamera;
        instance.transform.rotation = vrCamera.rotation;
    }
Esempio n. 7
0
    //// Update is called once per frame
    //void Update () {

    //}


    public void ChangeTutorialMenu(TutorialMenu newMenu)
    {
        //disable them all
        foreach (KeyValuePair <TutorialMenu, GameObject> item in tutorialMenuDict)
        {
            tutorialMenuDict[item.Key].SetActive(false);
        }

        //enable the new menu
        tutorialMenuDict[newMenu].SetActive(true);

        if (newMenu == TutorialMenu.Lore)
        {
            menuTitleText.text = "Lore";
        }
        else if (newMenu == TutorialMenu.Tutorial)
        {
            menuTitleText.text = "Tutorial";
        }
    }
Esempio n. 8
0
 private static bool Prefix(TutorialMenu __instance)
 {
     // Write some stuff so we can know, that we've successfully patched the game!
     Debug.Log("We've patched the game! YEY " + __instance.ButtonContainer);
     return(true);
 }
 public void AlignMenu(TutorialMenu instance)
 {
     instance.transform.position = vrCamera.position + vrCamera.forward * distanceToCamera;
     instance.transform.rotation = vrCamera.rotation;
 }
Esempio n. 10
0
 private void Awake()
 {
     tutorialMenu = FindObjectOfType <TutorialMenu>();
 }
Esempio n. 11
0
 void Awake()
 {
     timer = 0f;
     buttonsDisabled = false;
     hasPushedFirst = false;
     instance = this;
     foreach(UIPanel p in instance.PopupPanels) UITools.SetActiveState (p, false);
 }
Esempio n. 12
0
 void Awake()
 {
     instance  = this;
     colliders = GetComponentsInChildren <Collider> ();
 }