void IModBase.WorldExit() { try { OnWorldExit?.Invoke(); for (int i = 0; i < Components.Count; ++i) { try { Components[i].UnregisterComponent(); } catch (Exception e) { Log.Error($"Exception during {Components[i].GetType().Name}.UnregisterComponent(): {e.Message}", Log.PRINT_MESSAGE); Log.Error(e); } } Components.Clear(); ComponentRefreshFlags.Clear(); ComponentUpdateInput.Clear(); ComponentUpdateBeforeSim.Clear(); ComponentUpdateAfterSim.Clear(); ComponentUpdateDraw.Clear(); } finally { Session = null; Instance = null; } }
private void OnPointerExit(InputType type, int index, PointerEventData eventData) { switch (type) { case InputType.Inventory: { OnInventoryExit.Invoke(index); } break; case InputType.Target: { OnWorldExit.Invoke(eventData.position); } break; } }
/// <summary> /// Exits the world. /// </summary> public static void ExitWorld() { OnWorldExit?.Invoke(); }