public bool GetCollected(GameLevel gameLevel, CollectibleType collectibleType) { Dictionary <CollectibleType, bool> currentLevel; if (collection.TryGetValue(gameLevel, out currentLevel)) { bool retVal; if (currentLevel.TryGetValue(collectibleType, out retVal)) { return(retVal); } else { Debug.LogError("Score Collection: Found level, but could not find specific collectible type " + collectibleType.name); return(false); } } else { Debug.LogError("Could not find score collection for level: " + gameLevel); return(false); } }
public void SetCollect(GameLevel gameLevel, CollectibleType collectibleType, bool newValue) { collection[gameLevel][collectibleType] = newValue; }