Пример #1
0
        public static void ReleaseWorld <TState>(ref World world) where TState : State, new()
        {
            if (world == null || world.isActive == false)
            {
                world = null;
                return;
            }

            Worlds.DeInitializeBegin();
            var w = world;

            world.RecycleResetState <TState>();
            PoolClass <World> .Recycle(ref w);

            world.RecycleStates <TState>();
            Worlds.UnRegister(world);
            Worlds.DeInitializeEnd();
        }