public static void HideMiniMap()
    {
        instance.mask.transform.localScale = new Vector3(70f, 0f, 70f);
        instance.gameObject.SetActive(false);

        UIPowerBar.RemoveListener();
        UIPowerBar.StartRegen();
    }
Example #2
0
    // Update is called once per frame
    void LateUpdate()
    {
        if (!isPaused && Player.HasOrbem())
        {
            if (Player.CanSwitchWorld() && UIPowerBar.IsEmpty() && !WorldManager.IsWorldFuture() && MaskController.CanBeOpenedOrClosed())
            {
                StartCoroutine(TeleportToFuture());
            }


            if (Input.GetButtonDown("Open/Close Gate") && CanSwitchWorld())
            {
                SwitchWorld();
            }

            if (WorldManager.IsWorldFuture() && Input.GetButtonDown("MiniMap") && !UIPowerBar.IsEmpty())
            {
                MiniMapController.SwitchMiniMapState();
            }

            if (Input.GetKeyDown("v"))
            {
                Debug.Log("Start decrease");
                UIPowerBar.StartDecrease(2f);
            }

            if (Input.GetKeyDown("b"))
            {
                Debug.Log("Start regen");
                UIPowerBar.StartRegen();
            }
        }


        if (Input.GetButtonDown("Pause"))
        {
            if (isPaused)
            {
                Resume();
                UIManager.HidePauseMenu();
            }
            else
            {
                Pause();
                UIManager.DisplayPauseMenu();
            }
        }

        // delay next update by 1 frame to prevent from "jumping" with a controller
        if (isPaused && pauseExited)
        {
            isPaused    = false;
            pauseExited = false;
        }
    }
Example #3
0
    public IEnumerator TeleportToFuture()
    {
        Player.SwitchWorld();

        //change the transparence of the ghost
        GhostPlayer.SetVisible();

        // close the gate
        yield return(MaskController.instance.CloseGateAsync());

        // go back to transparent
        GhostPlayer.SetTranparent();

        // hide the second camera
        WorldManager.SwitchWorld();

        // UI
        UIPowerBar.RemoveListener();
        UIPowerBar.StartRegen();

        Player.instance.wallHit = false;
    }