private void Update() { foreach (PowerupType type in powerupQueue.Keys) { if (activePowerups.ContainsKey(type) && (!activePowerups.ContainsKey(type) || activePowerups[type]) || powerupQueue[type].Count <= 0) { continue; } PowerupHandle activePowerupHandle = powerupQueue[type].Dequeue(); PowerupIconInstance powerupIconInstance = activePowerupHandle.IconGameObject.AddComponent <PowerupIconInstance>(); powerupIconInstance.Initialize(activePowerupHandle); activePowerups[type] = true; } }
public void Initialize(PowerupHandle handle) { powerupHandle = handle; }