質問

I'm trying to keep my connection between the server and my clients, when the clients are switching the scene. How it could be possible?

役に立ちましたか?

解決

If the connection is tied to a MonoBehaviour you can just call DontDestroyOnLoad on that object.

Something like this

DontDestroyOnLoad( connectionObject );

You can read more about it here.

Note: you need to destroy the object by hand by calling Destroy when don't need it any more.

If the connection is not tied to a MonoBehaviour you need to keep a reference to it from an object that is not destroyed, for instance a Singleton.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top