private void GoHomeEnd() { fadeOutScreen.OnDarkeningEnd -= GoHomeEnd; if (BaseState.Instance != null) { Polyjam2019.CharacterEquipment equipment = FindObjectOfType <Polyjam2019.CharacterEquipment>(); Dictionary <Resource, int> resourcesGathered = new Dictionary <Resource, int>(); foreach (PickableData data in equipment.GetItemsIterator()) { if (!resourcesGathered.ContainsKey(data.Resource)) { resourcesGathered.Add(data.Resource, data.Amount); } else { resourcesGathered[data.Resource] += data.Amount; } } BaseState.Instance.ChangeValuesOfResources(resourcesGathered); } Application.LoadLevel("Base"); }
private void Awake() { equipment = GetComponent <CharacterEquipment>(); }