1
TNet 3 Support / Re: Dynamic Object IDs, changing channels and maintaining state, Asset Bundles
« on: December 15, 2015, 10:39:05 AM »
Hi ArenMook,
Out of curiosity, does the new version of TNet support asynchronous loading of resources?
For example, instead of using Resources.Load, use Resources.LoadAsync?
If not, I may have to modify the source to support it.
With the existing code I have, it would involve making TNManager.OnCreateObject start a coroutine to execute its functionality, and then also make the onLoadGameObject delegate in TNManager return an IEnumerator so it can be called as a coroutine.
*Edit*
Yikes, it's worse than that, TNManager.objectOwnerID is being used as a sort of global loading variable to the owner id of the object currently being created and referenced from TNObject.Awake to set the object's owner, which assumes that Create is being called synchronously. I'll need to investigate more.
Couldn't I just make objectOwnerID have a setter, and then from the CreateGameObject function set the owner ID after it is created?
*End Edit*
I'd also have to make a delegate for OnLoadLevelCoroutine so I could assign my own level loading code.
And then I'd have to be change the code to load from asset bundles asynchronously for both level load and asset loading. But I'm guessing things have changed in your latest version since you mention UnityTools LoadBinary, LoadResource, etc. which I don't have in my version of TNet.
When is the latest version coming out?
Thanks!
Out of curiosity, does the new version of TNet support asynchronous loading of resources?
For example, instead of using Resources.Load, use Resources.LoadAsync?
If not, I may have to modify the source to support it.
With the existing code I have, it would involve making TNManager.OnCreateObject start a coroutine to execute its functionality, and then also make the onLoadGameObject delegate in TNManager return an IEnumerator so it can be called as a coroutine.
*Edit*
Yikes, it's worse than that, TNManager.objectOwnerID is being used as a sort of global loading variable to the owner id of the object currently being created and referenced from TNObject.Awake to set the object's owner, which assumes that Create is being called synchronously. I'll need to investigate more.
Couldn't I just make objectOwnerID have a setter, and then from the CreateGameObject function set the owner ID after it is created?
*End Edit*
I'd also have to make a delegate for OnLoadLevelCoroutine so I could assign my own level loading code.
And then I'd have to be change the code to load from asset bundles asynchronously for both level load and asset loading. But I'm guessing things have changed in your latest version since you mention UnityTools LoadBinary, LoadResource, etc. which I don't have in my version of TNet.
When is the latest version coming out?
Thanks!
