private void UpdateNotification(MyEntityDetector entityDetector, ref MyHudNotification.MyNotification notification, MyEntity newEntity) { if (notification != null) { notification.Disappear(); notification = null; } if (newEntity != null) { MySmallShipInteractionActionEnum action = (MySmallShipInteractionActionEnum)entityDetector.GetNearestEntityCriterias(); notification = DisplayDetectedEntityActionNotification(newEntity, action); } }