forked from hunterzonewu/unity-decompiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayerController.cs
More file actions
65 lines (60 loc) · 2.24 KB
/
PlayerController.cs
File metadata and controls
65 lines (60 loc) · 2.24 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Decompiled with JetBrains decompiler
// Type: UnityEngine.Networking.PlayerController
// Assembly: UnityEngine.Networking, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 8B34E19C-EF53-416E-AE36-35C45BAFD2DE
// Assembly location: C:\Users\Blake\sandbox\unity\test-project\Library\UnityAssemblies\UnityEngine.Networking.dll
namespace UnityEngine.Networking
{
/// <summary>
/// <para>This represents a networked player.</para>
/// </summary>
public class PlayerController
{
/// <summary>
/// <para>The local player ID number of this player.</para>
/// </summary>
public short playerControllerId = -1;
internal const short kMaxLocalPlayers = 8;
/// <summary>
/// <para>The maximum number of local players that a client connection can have.</para>
/// </summary>
public const int MaxPlayersPerClient = 32;
/// <summary>
/// <para>The NetworkIdentity component of the player.</para>
/// </summary>
public NetworkIdentity unetView;
/// <summary>
/// <para>The game object for this player.</para>
/// </summary>
public GameObject gameObject;
/// <summary>
/// <para>Checks if this PlayerController has an actual player attached to it.</para>
/// </summary>
public bool IsValid
{
get
{
return (int) this.playerControllerId != -1;
}
}
public PlayerController()
{
}
internal PlayerController(GameObject go, short playerControllerId)
{
this.gameObject = go;
this.unetView = go.GetComponent<NetworkIdentity>();
this.playerControllerId = playerControllerId;
}
/// <summary>
/// <para>String representation of the player objects state.</para>
/// </summary>
/// <returns>
/// <para>String with the object state.</para>
/// </returns>
public override string ToString()
{
return string.Format("ID={0} NetworkIdentity NetID={1} Player={2}", new object[3]{ (object) this.playerControllerId, (object) (!((Object) this.unetView != (Object) null) ? "null" : this.unetView.netId.ToString()), (object) (!((Object) this.gameObject != (Object) null) ? "null" : this.gameObject.name) });
}
}
}