public static void AddGem(GoodGem g) { if (GatheredGems.ContainsKey(g.Type)) { GatheredGems[g.Type]++; } else { GatheredGems.Add(g.Type, 1); } Debug.Log("Gems: " + GatheredGems[g.Type]); Instance.UpdateGems(); }
private void OnTriggerEnter2D(Collider2D c) { Debug.Log(c.tag); if (c.tag == "Hazard") { TakeDamage(); Destroy(c.gameObject); SoundManager.PlaySound(SoundManager.Instance.BadGemSound); } else if (c.tag == "GoodGem") { Handheld.Vibrate(); GoodGem g = c.GetComponent <GoodGem>(); ScoreManager.AddGem(g); Destroy(c.gameObject); SoundManager.PlaySound(SoundManager.Instance.GoodGemSound); } }