Ejemplo n.º 1
0
        /// <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>();
 }
Ejemplo n.º 3
0
 /// <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));
 }