Ejemplo n.º 1
0
    public void Initialize()
    {
        panelManager   = MainHUD.GetPanelManager();
        inventoryPanel = (InventoryPanel)panelManager.GetPanelByType(BasePanel.PanelType.Inventory);

        //Debug.Log(panelManager + " is manager");
        //Debug.Log(inventoryPanel + " is inventory");

        SetupStartingItems();
    }
Ejemplo n.º 2
0
 private void Awake()
 {
     if (mainHud == null)
     {
         mainHud = this;
     }
     else
     {
         Destroy(this);
     }
 }
Ejemplo n.º 3
0
    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);
    }
Ejemplo n.º 4
0
    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()
    }
Ejemplo n.º 5
0
    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;
            }
        }
    }
Ejemplo n.º 6
0
 // 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;
 }
Ejemplo n.º 7
0
    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;
        }
    }
Ejemplo n.º 8
0
 private void Start()
 {
     player       = GetComponent <Player>();
     panelManager = MainHUD.GetPanelManager();
 }