Improved MLAPI Inspector UI

This commit is contained in:
Albin Corén 2018-03-30 04:06:49 +02:00
parent 0593de44a5
commit 614a3a4f19
7 changed files with 9 additions and 2 deletions

View File

@ -159,7 +159,7 @@ namespace MLAPI
private List<object> syncedFieldValues = new List<object>();
private List<MethodInfo> syncedVarHooks = new List<MethodInfo>();
//A dirty field is a field that's not synced.
public bool[] dirtyFields;
private bool[] dirtyFields;
internal void SyncVarInit()
{
FieldInfo[] sortedFields = GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy | BindingFlags.Instance).OrderBy(x => x.Name).ToArray();

View File

@ -5,6 +5,7 @@ using UnityEngine;
namespace MLAPI
{
[AddComponentMenu("MLAPI/NetworkedObject", -99)]
public class NetworkedObject : MonoBehaviour
{
[HideInInspector]

View File

@ -10,6 +10,7 @@ using System.Linq;
namespace MLAPI
{
[AddComponentMenu("MLAPI/NetworkingManager", -100)]
public class NetworkingManager : MonoBehaviour
{
public static float NetworkTime;
@ -19,6 +20,7 @@ namespace MLAPI
public GameObject DefaultPlayerPrefab;
public static NetworkingManager singleton;
//Client only, what my connectionId is on the server
[HideInInspector]
public int MyClientId;
internal Dictionary<int, NetworkedClient> connectedClients;
public Dictionary<int, NetworkedClient> ConnectedClients
@ -41,7 +43,7 @@ namespace MLAPI
private bool isListening;
private byte[] messageBuffer;
internal int serverClientId;
[HideInInspector]
public bool IsClientConnected;
public Action<int> OnClientConnectedCallback = null;
public Action<int> OnClientDisconnectCallback = null;

View File

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

View File

@ -4,6 +4,7 @@ using UnityEngine;
namespace MLAPI.MonoBehaviours.Prototyping
{
[AddComponentMenu("MLAPI/NetworkedAnimator")]
public class NetworkedAnimator : NetworkedBehaviour
{
public bool EnableProximity = false;

View File

@ -5,6 +5,7 @@ using UnityEngine.AI;
namespace MLAPI.MonoBehaviours.Prototyping
{
[AddComponentMenu("MLAPI/NetworkedNavMeshAgent")]
public class NetworkedNavMeshAgent : NetworkedBehaviour
{
private NavMeshAgent agent;

View File

@ -3,6 +3,7 @@ using UnityEngine;
namespace MLAPI.MonoBehaviours.Prototyping
{
[AddComponentMenu("MLAPI/NetworkedTransform")]
public class NetworkedTransform : NetworkedBehaviour
{
[Range(0f, 120f)]