FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
MLAPI/MLAPI-Examples/ManagerExamples.cs at master · dizzy2003/MLAPI · GitHub
dizzy2003
/
MLAPI
Public
forked from
Unity-Technologies/com.unity.netcode.gameobjects
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
MLAPI
/
MLAPI-Examples
/
ManagerExamples.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
42 lines (37 loc) · 1.15 KB
Breadcrumbs
MLAPI
/
MLAPI-Examples
/
ManagerExamples.cs
Copy path
File metadata and controls
42 lines (37 loc) · 1.15 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using
MLAPI
;
using
MLAPI
.
Connection
;
using
MLAPI
.
Security
;
using
MLAPI
.
Spawning
;
namespace
MLAPI_Examples
{
// Features example calls for things often needed for things like Game managers
public
class
ManagerExamples
:
NetworkedBehaviour
{
public
NetworkedObject
GetPlayerGameObject
(
ulong
clientId
)
{
return
SpawnManager
.
GetPlayerObject
(
clientId
)
;
}
// Only runs on host and client
public
NetworkedObject
GetLocalPlayerObject
(
)
{
return
SpawnManager
.
GetLocalPlayerObject
(
)
;
}
#if
!
DISABLE_CRYPTOGRAPHY
// Only runs on server
public
byte
[
]
GetAESKeyForClient
(
ulong
clientId
)
{
return
CryptographyHelper
.
GetClientKey
(
clientId
)
;
}
// Only runs on client
public
byte
[
]
GetAESKeyForServer
(
)
{
return
CryptographyHelper
.
GetServerKey
(
)
;
}
#endif
// Contains player object, owned objects, cryptography keys and more
public
NetworkedClient
GetClient
(
ulong
clientId
)
{
return
NetworkingManager
.
Singleton
.
ConnectedClients
[
clientId
]
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL