void ExitLevel() { if (entities != null) { foreach (IEntity ent in entities) { ent.Cleanup(); ent.Kill(); } } entities.Clear(); entities = null; korokke = null; if (pugs != null) { pugs.Clear(); pugs = null; } if (spawners != null) { spawners.Clear(); spawners = null; } if (OnLevelExit != null) { OnLevelExit(); } }
void BuildGoal() { KorokkeConfig korokkeCfg = FindObjectOfType <KorokkeConfig>(); Korokke korokkeInstance = Instantiate <Korokke>(korokkePrefab); korokkeInstance.Init(this); korokkeInstance.LoadData(korokkeCfg); AddEntity(korokkeInstance); DestroyImmediate(korokkeCfg.gameObject); }
// Specific lists/members addition/removal methods public void SetKorokke(Korokke theKorokke) { korokke = theKorokke; }