mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
合理化框架
合理化框架
This commit is contained in:
@@ -399,12 +399,6 @@ namespace TEngine
|
||||
|
||||
public void Deserialize(Scene scene, bool resetId = false)
|
||||
{
|
||||
if (IsDisposed)
|
||||
{
|
||||
Log.Error($"component is Disposed {this.GetType().FullName}");
|
||||
return;
|
||||
}
|
||||
|
||||
if (RuntimeId != 0)
|
||||
{
|
||||
return;
|
||||
|
@@ -70,7 +70,7 @@ namespace TEngine
|
||||
public void CreateSession(string remoteAddress, NetworkProtocolType networkProtocolType, Action onConnectComplete, Action onConnectFail, int connectTimeout = 5000)
|
||||
{
|
||||
var address = NetworkHelper.ToIPEndPoint(remoteAddress);
|
||||
var clientNetworkComponent = AddComponent<ClientNetworkComponent>();
|
||||
var clientNetworkComponent = GetComponent<ClientNetworkComponent>() ?? AddComponent<ClientNetworkComponent>();
|
||||
clientNetworkComponent.Initialize(networkProtocolType, NetworkTarget.Outer);
|
||||
clientNetworkComponent.Connect(address, onConnectComplete, onConnectFail, connectTimeout);
|
||||
Session = clientNetworkComponent.Session;
|
||||
|
Reference in New Issue
Block a user