public void Collect(Collectable.CollectType type) { switch (type) { case Collectable.CollectType.CAN: audioSource.clip = canAudio; break; case Collectable.CollectType.ORANGE: audioSource.clip = orangeAudio; break; case Collectable.CollectType.APPLE: audioSource.clip = appleAudio; break; case Collectable.CollectType.SUGAR: audioSource.clip = sugarAudio; break; case Collectable.CollectType.WATER: audioSource.clip = waterAudio; break; case Collectable.CollectType.LOVE: audioSource.clip = loveAudio; break; default: Debug.Log("Collectable does not contain that CollectType"); break; } audioSource.Play(); }
public void CollectIngredient(Collectable.CollectType ingredient) { FindObjectOfType <GameMaster>().collectInWorld--; if (!ingredientsCollected.Contains(ingredient)) { ingredientsCollected.Add(ingredient); mainCollected = ingredientsCollected.Count; } }
public CollectableSpawnDetail(Collectable.CollectType collType, int collXPos) { this.Type = collType; this.CollectXPos = collXPos; this.Spawned = false; }