BREAKING CHANGE: renamed original Behaviour class to BehaviourInternal, and replaced it with BehaviourBase
Original Behaviour was using old methods for detecting entering/exiting universe, they are now all under the same hood and the original is kept for UniverseEntranceManager because it needs to enter the universe without itself. The internal behaviour kept under a subnamespace of "Core.Internal" for the purpose that it might come in handy for other use cases.
This commit is contained in:
@@ -9,7 +9,7 @@ using LiteNetLib.Utils;
|
||||
|
||||
namespace Engine.Systems.Network;
|
||||
|
||||
public abstract class LiteNetLibCommunicatorBase : Behaviour, INetworkCommunicator
|
||||
public abstract class LiteNetLibCommunicatorBase : Behaviour, IEnterUniverse, IExitUniverse, INetworkCommunicator
|
||||
{
|
||||
protected readonly NetPacketProcessor netPacketProcessor = new();
|
||||
|
||||
@@ -33,15 +33,13 @@ public abstract class LiteNetLibCommunicatorBase : Behaviour, INetworkCommunicat
|
||||
return this;
|
||||
}
|
||||
|
||||
protected override void OnEnteredUniverse(IUniverse universe)
|
||||
public virtual void EnterUniverse(IUniverse universe)
|
||||
{
|
||||
base.OnEnteredUniverse(universe);
|
||||
logger = universe.FindBehaviour<ILogger>();
|
||||
}
|
||||
|
||||
protected override void OnExitedUniverse(IUniverse universe)
|
||||
public virtual void ExitUniverse(IUniverse universe)
|
||||
{
|
||||
base.OnExitedUniverse(universe);
|
||||
logger = null;
|
||||
Stop();
|
||||
}
|
||||
|
Reference in New Issue
Block a user