//When Player touches the HoboCoin, it disappears and calls a method to add one HoboCoin into the collectables void OnTriggerEnter2D(Collider2D colli) { if (colli.CompareTag("Playa")) { SoundManager.instance.musicSource.PlayOneShot(coin, 0.5f); DestroyObject(this.gameObject); StatKeeper.collectHoboCoin(); } }
void OnTriggerEnter2D(Collider2D colli) { if (colli.CompareTag("NPC")) { dialog.text = DialogScript.getDialog(int.Parse(colli.gameObject.name)); /*}else if (colli.CompareTag("Wench")) { * dialog.text = DialogScript.getDialog(int.Parse(colli.gameObject.name)); */ } else if (colli.CompareTag("HiddenHoboCoin") == true) { Debug.Log("Oh look, a HoboCoin !"); StatKeeper.collectHoboCoin(); } else if (colli.CompareTag("HostileNPC") == true) { StatKeeper.receiveDamage(2); } else if (colli.CompareTag("YellowKnight") == true) { if (YellowKnightToggle.activeSelf == false) { YellowKnightToggle.SetActive(true); } } else if (colli.CompareTag("BlueKnight") == true) { if (BlueKnightToggle.activeSelf == false) { BlueKnightToggle.SetActive(true); } } else if (colli.CompareTag("BloodyKnight") == true) { if (BloodyKnightToggle.activeSelf == false) { BloodyKnightToggle.SetActive(true); } } else { dialog.text = DialogScript.getNullDialog(); } }
/// <summary> /// Doggos the discovered = checks if the doggo is already discovered, otherwise sets it as discovered and updates discoveredDoggos integer. /// </summary> /// <param name="doggonumber">Doggonumber.</param> public static void DoggoDiscovered(int doggonumber) { if (doggos [doggonumber]) { Debug.Log("Already found this Doggo !"); } else { markAsFound(doggonumber); if (doggonumber == 22) { StatKeeper.collectHoboCoin(); } discoveredDoggos++; Debug.Log("Doggos found: " + discoveredDoggos); } }