Esempio n. 1
0
    private void Start()
    {
        uiHotBar        = FindObjectOfType <UI_HotBar>();
        uiMainInventory = FindObjectOfType <UI_PlayerInventory>();

        uiHotBar.SetupInventory(hotBarInventory);
        uiMainInventory.SetupInventory(mainInventory);

        inventoriesController.activeInventories.Add(hotBarInventory);

        uIController.AddUI(uiHotBar);
    }
Esempio n. 2
0
    private Vector2 pos  = new Vector2(0, 0);                  // Position coin supérieur gauche par rapport au noeud parent, par défaut à (0,0)


    public override void _Ready()
    {
        instance    = this;
        itemList    = GetNode <ItemList>("List");
        inventories = GetNode <HBoxContainer>("Inventories");
        btItems     = GetNode("Inventories").GetNode <Button>("Items");
        btBuildings = GetNode("Inventories").GetNode <Button>("Buildings");
        btUsable    = GetNode("Inventories").GetNode <Button>("Usable");
        btClose     = GetNode("Inventories").GetNode <Button>("Close");

        inventories.RectSize     = size;                                                                      //Définit la taille de la barre des boutons et de l'itemListe
        itemList.RectSize        = new Vector2(size.x, size.y * 9);
        inventories.RectPosition = pos;
        itemList.RectPosition    = new Vector2(pos.x, pos.y + inventories.RectSize.y);
        SizeTextButtons();                                                                                    //Définit le texte des boutons mais la taille ne fonctionne pas (détail dans la fonction)
    }
Esempio n. 3
0
    private void Start()
    {
        uIController    = FindObjectOfType <UIController>();
        pauseMenu       = FindObjectOfType <PauseMenu>();
        currentCategory = CategoryType.Test1;
        playerInventory = FindObjectOfType <UI_PlayerInventory>();
        hotbarInventory = FindObjectOfType <UI_HotBar>();

        recipeCollection = RecipeManager.Read();
        itemCollection   = ItemManager.Read();

        isActive = false;

        uIController.togglableUIs.Add(gameObject);

        UpdateUI();
    }