Ejemplo n.º 1
0
        /// <summary>
        /// Sets the information on the information panel based on the information set on both the info and assets.
        /// </summary>
        public void SetInfoPanel(string equipmentID)
        {
            WeaponInfo  info  = weaponServicer.GetWeaponItem(equipmentID);
            WeaponAsset asset = GameManager.Instance.weaponSettings.RetrieveFromSettings(info.weaponType, info.globalID);

            informationPanel.SetActive(true);
            InformationPanel infoPanel = informationPanel.GetComponent <InformationPanel>();

            infoPanel.SetPanelInfo(info.name, asset.description, asset.spriteThumbnail);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Called to instantiate an equipment cell using the specified prefab.
        /// </summary>
        public void SpawnEquipmentCell(string identifier, GameObject cellPrefab, List <GameObject> inventoryCells)
        {
            if (identifier == "")
            {
                GameObject emptyCell       = GameManager.Instance.uiSettings.emptyListCell;
                GameObject spawnedInstance = Instantiate(emptyCell, contentView.transform);
                inventoryCells.Add(spawnedInstance);
            }
            else
            {
                WeaponInfo info            = weaponServicer.GetWeaponItem(identifier);
                GameObject spawnedInstance = Instantiate(cellPrefab, contentView.transform);

                IInventoryCell cellInterface = spawnedInstance.GetComponent <IInventoryCell>();
                cellInterface.InitialiseCell(info);
                cellInterface.PassInterfaces(infoPanel);
                //cellInterface.SetColor(GetWeaponCellColor(equipmentMenu.GetCurrentType())); DOES NOT WORK UNTIL EQUIPMENT TYPES ARE CONSIDERED.

                IUICellChecker equipmentInterface = spawnedInstance.GetComponent <IUICellChecker>();
                equipmentInterface.SetCell(slotChecker, assigner, true);

                inventoryCells.Add(spawnedInstance);
            }
        }