void Cruise(UIMenu menu) { var newitem = new UIMenuCheckboxItem("Cruise", false); menu.AddItem(newitem); menu.OnCheckboxChange += (sender, item, checked_) => { if (item == newitem) { Autopilot.Cruise(checked_); } }; }
void DriveTo(UIMenu menu) { var newitem = new UIMenuCheckboxItem("Drive to", false); menu.AddItem(newitem); menu.OnCheckboxChange += (sender, item, checked_) => { if (item == newitem) { Autopilot.DriveTo(checked_); } }; }