public void Initialize() { panelManager = MainHUD.GetPanelManager(); inventoryPanel = (InventoryPanel)panelManager.GetPanelByType(BasePanel.PanelType.Inventory); //Debug.Log(panelManager + " is manager"); //Debug.Log(inventoryPanel + " is inventory"); SetupStartingItems(); }
private void Awake() { if (mainHud == null) { mainHud = this; } else { Destroy(this); } }
private void SetCameraConfines() { Vector2 halfCamSize = new Vector2(9f, 5f); Vector2 minXPos = (Vector2)transform.position - new Vector2((roomSize.x / 2) - halfCamSize.x, 0f); Vector2 minYPos = (Vector2)transform.position - new Vector2(0f, (roomSize.y / 2) - halfCamSize.y); Vector2 maxXPos = (Vector2)transform.position + new Vector2((roomSize.x / 2) - halfCamSize.x, 0f); Vector2 maxYPos = (Vector2)transform.position + new Vector2(0f, (roomSize.y / 2) - halfCamSize.y); MainHUD.SetCameraBounds(minXPos, maxXPos, minYPos, maxYPos); }
public void OnAbilitySlotKeyPressed(int i) { PlayerAbilitySlot targetSlot = MainHUD.GetAbilitySlotByIndex(i - 1); if (targetSlot.CurrentCard != null) { deckManager.Hand.PlayCard(targetSlot.CurrentCard, Controller.collisionInfo, targetSlot.slotType); } //deckManager.Hand.PlayCard() }
public void RemoveCard(AbilityCard card) { if (activeCards.RemoveIfContains(card)) { switch (deckType) { case DeckType.Hand: MainHUD.ClearPlayerSlot(card, PlayerAbilitySlot.SlotType.Cycling); break; case DeckType.PrimaryCards: MainHUD.ClearPlayerSlot(card, PlayerAbilitySlot.SlotType.Primary); break; } } }
// ResetVariables - Clears and sets variables to their initial states. // NOTES: - Should typically only be called when loading a level. // - For references, objects that aren't destroyed should not be nulled out! void ResetVariables() { Time.timeScale = 1; state = GameState.Menu; timer = 0; if (paused) { TogglePause(); } marble = null; cam = null; respawn = null; //gui = null; finishLine = null; pauseMenu = null; hud = null; }
public void Addcard(AbilityCard card) { if (card.currentDeck == null) { card.currentDeck = this; } activeCards.Add(card); switch (deckType) { case DeckType.Hand: MainHUD.SetPlayerSlot(card, PlayerAbilitySlot.SlotType.Cycling); break; case DeckType.PrimaryCards: MainHUD.SetPlayerSlot(card, PlayerAbilitySlot.SlotType.Primary); break; } }
private void Start() { player = GetComponent <Player>(); panelManager = MainHUD.GetPanelManager(); }