// Get follower references to set up equipment slots and assign index numbers to each slot private void RegisterEquipment() { Inventory playerInventory = Inventory.GetPlayerInventory(); // Equipment followerEquipment = Equipment.GetEntityEquipment("Follower"); FollowerManager followerManager = GameObject.FindWithTag("LevelManager").GetComponent <FollowerManager>(); GameObject followerGO; if (!followerManager.GetActiveFollowerObject(out followerGO)) { return; } Equipment followerEquipment = followerGO.GetComponent <Equipment>(); equipmentSlots ??= GetComponentsInChildren <EquipmentSlotUI>(); Dictionary <EquipLocation, int> equipSlotLookup = new Dictionary <EquipLocation, int>(); foreach (var slot in equipmentSlots) { EquipLocation equipLocation = slot.GetEquipLocation(); if (equipSlotLookup.ContainsKey(equipLocation)) { equipSlotLookup[equipLocation]++; } else { equipSlotLookup[equipLocation] = 0; } slot.Setup(playerInventory, followerEquipment, equipSlotLookup[equipLocation]); } }
private void GetFollowerComponents() { GameObject followerGO; if (followerManager.GetActiveFollowerObject(out followerGO)) { characterEquipment = followerGO.GetComponent <Equipment>(); characterStats = followerGO.GetComponent <BaseStats>(); RedrawStatDisplay(); } }
public void OnFollowerChange() { FollowerManager followerManager = GameObject.FindGameObjectWithTag("LevelManager").GetComponent <FollowerManager>(); GameObject followerGO; if (followerManager.GetActiveFollowerObject(out followerGO)) { string sceneToLoad = "DescriptionTest"; PopulateDescriptionText(sceneToLoad, followerGO); } }
public void OnFollowerChange() { // Get new follower reference and pass in updated equipment to Equipment Slots FollowerManager followerManager = GameObject.FindWithTag("LevelManager").GetComponent <FollowerManager>(); GameObject followerGO; if (!followerManager.GetActiveFollowerObject(out followerGO)) { return; } Equipment followerEquipment = followerGO.GetComponent <Equipment>(); foreach (var slot in equipmentSlots) { slot.OnFollowerChange(followerEquipment); } }