void FixedUpdate() { if (initialization) { if (!UIPowerBar.IsVisible()) { HidePowerBar(); } HideKey(); initialization = false; } if (Player.HasOrbem()) { if (Player.CanSwitchWorld() && orbState.Equals(OrbState.NOTACTIVABLE)) { orbState = OrbState.ACTIVABLE; UIPowerBar.EnablePowerBar(); } else if (!Player.CanSwitchWorld() && orbState.Equals(OrbState.ACTIVABLE)) { orbState = OrbState.NOTACTIVABLE; UIPowerBar.DisablePowerBar(); } } }
public static void HideMiniMap() { instance.mask.transform.localScale = new Vector3(70f, 0f, 70f); instance.gameObject.SetActive(false); UIPowerBar.RemoveListener(); UIPowerBar.StartRegen(); }
protected override void Activate() { if (CanSwitchWorld() && Player.CanSwitchWorld() && !UIPowerBar.IsEmpty()) { Switch(); GameManager.SwitchWorld(); animator.SetTrigger("zoomIn"); } }
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); }
// 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; } }
public void OnPowerBarEmpty() { if (Player.CanSwitchWorld()) { GameManager.SwitchWorld(); } else { UIPowerBar.BlockRegen(); } }
// Use this for initialization void Awake() { if (instance == null) { instance = this; orbActivable.enabled = true; orbNonActivable.enabled = false; } else { Destroy(gameObject); } }
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; }
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; }
public static void HidePowerBar() { UIPowerBar.Hide(); UICollectable.ChangeYPosition(-40f); }
public static void ShowPowerBar() { UIPowerBar.Show(); UICollectable.ChangeYPosition(-130f); }
public bool CanSwitchWorld() { return(Player.CanSwitchWorld() && !UIPowerBar.IsEmpty() && MaskController.CanBeOpenedOrClosed()); }