protected override void OnActivate() { base.OnActivate(); _view = UIRoot.I.GetView<LevelSelectView>(); _view.SetVisible(true); EventController.I.Subscribe("LevelSelected", this); // EventController.I.Subscribe("SelectLeft", this); // EventController.I.Subscribe("SelectRight", this); EventController.I.Subscribe("BackPressed", this); // CreateLevels(0, 20); // SelectFirstPart(); GA.I.LogScreen("Level Select"); }
protected override void OnDeactivate() { base.OnDeactivate(); EventController.I.Unsubscribe("LevelSelected", this); EventController.I.Unsubscribe("SelectLeft", this); EventController.I.Unsubscribe("SelectRight", this); EventController.I.Unsubscribe("BackPressed", this); foreach (var gameObject in _levels) { GameObject.Destroy(gameObject); } _levels.Clear(); _view.SetVisible(false); }
protected override void OnActivate() { base.OnActivate(); _view = UIRoot.I.GetView <LevelSelectView>(); _view.SetVisible(true); EventController.I.Subscribe("LevelSelected", this); EventController.I.Subscribe("SelectLeft", this); EventController.I.Subscribe("SelectRight", this); EventController.I.Subscribe("BackPressed", this); CreateLevels(0, 10); CreateLevels(10, 10); SelectFirstPart(); GA.I.LogScreen("Level Select"); }