// Start is called before the first frame update
    void Start()
    {
        DisableAllMenus();
        EnableMenu(StartingMenuName);

        AppEvents.Invoke_OnMouseCursorEnable(true);
    }
 public void OnPause(InputValue button)
 {
     if (!GameManager.Instance.CursorActive)
     {
         AppEvents.Invoke_OnMouseCursorEnable(true);
     }
     Time.timeScale = 1;
     SceneManager.LoadScene("MainMenu");
 }
Exemple #3
0
    public void PauseGame()
    {
        var pausables = FindObjectsOfType <MonoBehaviour>().OfType <IPausable>();

        foreach (IPausable pauseObject in pausables)
        {
            pauseObject.PauseGame();
        }

        Time.timeScale = 0;
        AppEvents.Invoke_OnMouseCursorEnable(true);
    }
Exemple #4
0
    public void UnPauseGame()
    {
        var pausables = FindObjectsOfType <MonoBehaviour>().OfType <IPausable>();

        foreach (IPausable pause in pausables)
        {
            pause.UnPauseMenu();
        }

        Time.timeScale = 1.0f;
        AppEvents.Invoke_OnMouseCursorEnable(false);
    }
Exemple #5
0
 protected virtual void EnableUI(bool enable)
 {
     //Set UI Visibility
     ui.SetActive(enable);
     //Lock/Unlock Player
     player.enabled = !enable;
     foreach (var ui in playerUI)
     {
         ui.enabled = !enable;
     }
     AppEvents.Invoke_OnMouseCursorEnable(enable);
 }
    private void Awake()
    {
        MenuController = FindObjectOfType <MenuController>();
        if (MenuController)
        {
            MenuController.AddMenu(MenuName, this);
        }
        else
        {
            Debug.LogError("Message Controller not found");
        }

        AppEvents.Invoke_OnMouseCursorEnable(true);
    }
Exemple #7
0
 public void OnEnding()
 {
     if (hasKey)
     {
         if (!GameManager.Instance.CursorActive)
         {
             AppEvents.Invoke_OnMouseCursorEnable(true);
         }
         Time.timeScale = 1;
         SceneManager.LoadScene("End");
     }
     else
     {
         Debug.Log("No Key");
     }
 }
Exemple #8
0
    // Start is called before the first frame update
    private void Start()
    {
        if (GameManager.Instance.CursorActive)
        {
            AppEvents.Invoke_OnMouseCursorEnable(false);
        }

        CrosshairStartingPosition = new Vector2(Screen.width / 2f, Screen.height / 2f);

        HorizontalOffset             = (Screen.width * CrosshairHorizontalPercentage) / 2f;
        MinHorizontalDeltaConstraint = -(Screen.width / 2f) + HorizontalOffset;
        MaxHorizontalDeltaConstraint = (Screen.width / 2f) - HorizontalOffset;

        VerticalOffset             = (Screen.height * CrosshairVerticalPercentage) / 2f;
        MinVerticalDeltaConstraint = -(Screen.height / 2f) + VerticalOffset;
        MaxVerticalDeltaConstraint = (Screen.height / 2f) - VerticalOffset;
    }
    // Start is called before the first frame update
    void Start()
    {
        if (GameManager.Instance.CursorActive)
        {
            AppEvents.Invoke_OnMouseCursorEnable(false);
        }

        crosshairStartingPosition = new Vector2(Screen.width / 2.0f, Screen.height / 2.0f);

        horizontalOffset             = (Screen.width * crosshairHorizontalPercentage) / 2.0f;
        minHorizontalDeltaConstraint = -(Screen.width / 2.0f) + horizontalOffset;
        maxHorizontalDeltaConstraint = (Screen.width / 2.0f) - horizontalOffset;

        verticalOffset             = (Screen.height * crosshairVerticalPercentage) / 2.0f;
        minVerticalDeltaConstraint = -(Screen.height / 2.0f) + verticalOffset;
        maxVerticalDeltaConstraint = (Screen.height / 2.0f) - verticalOffset;
    }
Exemple #10
0
 private void Awake()
 {
     AppEvents.Invoke_OnMouseCursorEnable(true);
 }
Exemple #11
0
 // Start is called before the first frame update
 void Start()
 {
     AppEvents.Invoke_OnMouseCursorEnable(true);
 }