public static void DisplayMiniMap()
    {
        instance.mask.transform.localScale = new Vector3(160f, 0f, 90f);
        instance.gameObject.SetActive(true);

        // the minimap consume power, start depleting the power bar
        UIPowerBar.SetListener(new PowerBarListenerForMiniMap());
        UIPowerBar.StartDecrease(1f);
    }
Exemple #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;
        }
    }
Exemple #3
0
    public void TeleportToPresent()
    {
        MiniMapController.HideMiniMap();
        Player.SwitchWorld();

        // UI
        UIPowerBar.SetListener(new PowerBarListenerForSwitch());
        UIPowerBar.StartDecrease(2f);

        // start opening the gate asynchronously
        Debug.Log("OpenGate Async");
        instance.StartCoroutine(MaskController.instance.OpenGateAsync());

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

        Player.instance.wallHit = false;
    }