Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
        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;
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Exits the world.
 /// </summary>
 public static void ExitWorld()
 {
     OnWorldExit?.Invoke();
 }