Skip to content

Commit 614a3a4

Browse files
committed
Improved MLAPI Inspector UI
1 parent 0593de4 commit 614a3a4

7 files changed

+9
-2
lines changed

MLAPI/MonoBehaviours/Core/NetworkedBehaviour.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ private void OnDestroy()
159159
private List<object> syncedFieldValues = new List<object>();
160160
private List<MethodInfo> syncedVarHooks = new List<MethodInfo>();
161161
//A dirty field is a field that's not synced.
162-
public bool[] dirtyFields;
162+
private bool[] dirtyFields;
163163
internal void SyncVarInit()
164164
{
165165
FieldInfo[] sortedFields = GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy | BindingFlags.Instance).OrderBy(x => x.Name).ToArray();

MLAPI/MonoBehaviours/Core/NetworkedObject.cs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
namespace MLAPI
77
{
8+
[AddComponentMenu("MLAPI/NetworkedObject", -99)]
89
public class NetworkedObject : MonoBehaviour
910
{
1011
[HideInInspector]

MLAPI/MonoBehaviours/Core/NetworkingManager.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
namespace MLAPI
1212
{
13+
[AddComponentMenu("MLAPI/NetworkingManager", -100)]
1314
public class NetworkingManager : MonoBehaviour
1415
{
1516
public static float NetworkTime;
@@ -19,6 +20,7 @@ public class NetworkingManager : MonoBehaviour
1920
public GameObject DefaultPlayerPrefab;
2021
public static NetworkingManager singleton;
2122
//Client only, what my connectionId is on the server
23+
[HideInInspector]
2224
public int MyClientId;
2325
internal Dictionary<int, NetworkedClient> connectedClients;
2426
public Dictionary<int, NetworkedClient> ConnectedClients
@@ -41,7 +43,7 @@ public bool isHost
4143
private bool isListening;
4244
private byte[] messageBuffer;
4345
internal int serverClientId;
44-
46+
[HideInInspector]
4547
public bool IsClientConnected;
4648
public Action<int> OnClientConnectedCallback = null;
4749
public Action<int> OnClientDisconnectCallback = null;

MLAPI/MonoBehaviours/Core/TrackedObject.cs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ namespace MLAPI.MonoBehaviours.Core
77
{
88
//Based on: https://twotenpvp.github.io/lag-compensation-in-unity.html
99
//Modified to be used with latency rather than fixed frames and subframes. Thus it will be less accrurate but more modular.
10+
[AddComponentMenu("MLAPI/TrackedObject", -98)]
1011
public class TrackedObject : MonoBehaviour
1112
{
1213
internal Dictionary<float, TrackedPointData> FrameData = new Dictionary<float, TrackedPointData>();

MLAPI/MonoBehaviours/Prototyping/NetworkedAnimator.cs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace MLAPI.MonoBehaviours.Prototyping
66
{
7+
[AddComponentMenu("MLAPI/NetworkedAnimator")]
78
public class NetworkedAnimator : NetworkedBehaviour
89
{
910
public bool EnableProximity = false;

MLAPI/MonoBehaviours/Prototyping/NetworkedNavMeshAgent.cs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
namespace MLAPI.MonoBehaviours.Prototyping
77
{
8+
[AddComponentMenu("MLAPI/NetworkedNavMeshAgent")]
89
public class NetworkedNavMeshAgent : NetworkedBehaviour
910
{
1011
private NavMeshAgent agent;

MLAPI/MonoBehaviours/Prototyping/NetworkedTransform.cs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace MLAPI.MonoBehaviours.Prototyping
55
{
6+
[AddComponentMenu("MLAPI/NetworkedTransform")]
67
public class NetworkedTransform : NetworkedBehaviour
78
{
89
[Range(0f, 120f)]

0 commit comments

Comments
 (0)