forked from Unity-Technologies/EntityComponentSystemSamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSecureBootstrapExtension.cs
More file actions
22 lines (21 loc) · 931 Bytes
/
Copy pathSecureBootstrapExtension.cs
File metadata and controls
22 lines (21 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// #define ENABLE_NETCODE_SAMPLE_SECURE
namespace Samples.HelloNetcode
{
#if ENABLE_NETCODE_SAMPLE_SECURE
[UnityEngine.Scripting.Preserve]
public class SecureBootStrapExtension : NetCodeBootstrap
{
public override bool Initialize(string defaultWorldName)
{
// To set up a custom driver the constructor for it needs to be hooked up
// before world creation in the bootstrap system. The netcode bootstrap is
// already defined in the main connection sample and as there can
// be only one set up in the project, we just add this line here on top of
// the existing NetCodeBootstrap class (normally a project would only have
// the boostrap defined in one place).
NetworkStreamReceiveSystem.DriverConstructor = new SecureDriverConstructor();
return base.Initialize(defaultWorldName);
}
}
#endif
}