/// <summary> /// Ajoute les informations du collectible dans la database "LEVEL" /// </summary> public void AddCollectible(ItemCollectible collectible) { SelectCurrentSceneState(); int nbInScene = currentSceneState.nbCollectedItemInScene; nbInScene++; currentSceneState.nbCollectedItemInScene = nbInScene; currentSceneState.itemsCollectedList.Add(collectible.itemName); database.totalCollected++; database.score += collectible.itemValue; SaveGameData("Save.json"); UpdateScoreBoard(); }
// Use this for initialization void Awake() { item = this.gameObject.GetComponent <ItemCollectible>(); }
/// <summary> /// Retour True si le collectible passé en parametre à déjà été collecté /// </summary> public bool CheckIfCollected(ItemCollectible collectible) { SelectCurrentSceneState(); return(currentSceneState.itemsCollectedList.Contains(collectible.itemName)); }