17 lines
		
	
	
		
			676 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			676 B
		
	
	
	
		
			C#
		
	
	
	
	
	
using Engine.Core;
 | 
						|
 | 
						|
namespace Engine.Systems.Network;
 | 
						|
 | 
						|
/// <summary>
 | 
						|
/// Basic client behaviour that finds the <see cref="INetworkCommunicatorClient"/> in the universe in it's first active frame.
 | 
						|
/// <br/> 
 | 
						|
/// Disclaimer: It implements <see cref="IFirstFrameUpdate"/> and <see cref="ILastFrameUpdate"/> in virtual methods.
 | 
						|
/// </summary>
 | 
						|
public class ClientBehaviour : Behaviour, IFirstFrameUpdate, ILastFrameUpdate
 | 
						|
{
 | 
						|
    public INetworkCommunicatorClient Client { get; private set; } = null!;
 | 
						|
 | 
						|
    public virtual void FirstActiveFrame() => Client = Universe.FindRequiredBehaviour<INetworkCommunicatorClient>();
 | 
						|
    public virtual void LastActiveFrame() => Client = null!;
 | 
						|
}
 |