static public void EndEvent() { gameManager.AddScore(currentEvenement.GetEventType()); evenements.Remove(currentEvenement); Destroy(currentEvenement.GetNPC()); Destroy(currentEvenement.GetMainObject()); currentEvenement = null; SoundManager.instance.CitizenSave(); }
static public void LaunchEvent(GameObject currentEventZone) { if (currentEvenement == null) { foreach (Evenement evenement in evenements) { if (evenement.GetMainObject().GetInstanceID() == currentEventZone.GetInstanceID()) { currentEvenement = evenement; if (currentEvenement.GetNPC() != null) { currentEvenement.GetMainObject().transform.DetachChildren(); //currentEvenement.GetNPC().transform.parent = player.transform; } currentEvenement.GetMainObject().GetComponent <Collider2D>().enabled = false; currentEvenement.SetRescued(); break; } } } }