// Entity or Plant controller has added an object. Make sure this entity can have world scheduled events. private void Controller_AddGameObject(object sender, GameObjectEventArgs e) { e.gameObject.ScheduleEvent += OnScheduleEvent; if (e.gameObject is Item pickup) { Items.Add(pickup); } }
// Entity or Plant controller is removing an object. Make sure event hooks are removed. private void Controller_RemoveGameObject(object sender, GameObjectEventArgs e) { e.gameObject.ScheduleEvent -= OnScheduleEvent; }