Skip to content

Instantly share code, notes, and snippets.

View kamyker's full-sized avatar
🍉

Kamil Szurant kamyker

🍉
View GitHub Profile
@kamyker
kamyker / Unity-hotswapping-notes.md
Created October 4, 2022 11:16 — forked from cobbpg/Unity-hotswapping-notes.md
Unity hotswapping notes

Unity hotswapping notes

Unity has built-in support for hotswapping, which is a huge productivity booster. This feature works not only with graphics assets like bitmaps and meshes, but also with code: if you edit the source and save it, the editor will save the state of the running game, compile and load the new code, then load the saved state and continue where it left off. Unfortunately, this feature is very easy to break, and most available 3rd party plugins have little regard for it.

It looks like there’s a lot of confusion about hotswapping in Unity, and many developers are not even aware of its existence – which is no wonder if their only experience is seeing lots of errors on the console when they forget to stop the game before recompiling... This document is an attempt to clear up some of this confusion.

Nota bene, I’m not a Unity developer, so everything below is based on blog posts and experimentation. Corrections are most welcome!

The basic flow of hotswapping

@kamyker
kamyker / network-tweak.md
Created May 27, 2022 00:00 — forked from mustafaturan/network-tweak.md
Linux Network Tweak for 2 million web socket connections

Sample config for 2 million web socket connection

    sysctl -w fs.file-max=12000500
    sysctl -w fs.nr_open=20000500
    # Set the maximum number of open file descriptors
    ulimit -n 20000000

    # Set the memory size for TCP with minimum, default and maximum thresholds 
 sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
@kamyker
kamyker / PackageDownloader.cpp
Created May 25, 2020 00:08 — forked from emrahgunduz/PackageDownloader.cpp
Package Downloader And Mounter For Unreal Engine 4 -- Do not forget to correct the include and api name if you are copy pasting this code
#include "HitMe.h"
#include "PackageDownloader.h"
#include "IPlatformFilePak.h"
#include "HitMeSingleton.h"
UPackageDownloader* UPackageDownloader::GetPackageDownloader(FString PackageName, FString URL, bool& IsValid)
{
IsValid = false;
UPackageDownloader *Object = NewObject<UPackageDownloader>();