Skip to content

Commit eaaaf46

Browse files
committed
Replaced camel case variables with pascal casing
1 parent 13d6d02 commit eaaaf46

30 files changed

+370
-330
lines changed

MLAPI-Editor/NetworkedBehaviourEditor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void RenderNetworkedVarValueType<T>(int index) where T : struct
9191
object val = var.Value;
9292
string name = networkedVarNames[index];
9393

94-
if (NetworkingManager.singleton != null && NetworkingManager.singleton.isListening)
94+
if (NetworkingManager.Singleton != null && NetworkingManager.Singleton.IsListening)
9595
{
9696
if (type == typeof(int))
9797
val = EditorGUILayout.IntField(name, (int)val);

MLAPI-Editor/NetworkedObjectEditor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ private void Init()
2121
public override void OnInspectorGUI()
2222
{
2323
Init();
24-
if (NetworkingManager.singleton == null || (!NetworkingManager.singleton.isServer && !NetworkingManager.singleton.isClient))
24+
if (NetworkingManager.Singleton == null || (!NetworkingManager.Singleton.IsServer && !NetworkingManager.Singleton.IsClient))
2525
base.OnInspectorGUI(); //Only run this if we are NOT running server. This is where the ServerOnly box is drawn
2626

27-
if (!networkedObject.isSpawned && NetworkingManager.singleton != null && NetworkingManager.singleton.isServer)
27+
if (!networkedObject.isSpawned && NetworkingManager.Singleton != null && NetworkingManager.Singleton.IsServer)
2828
{
2929
EditorGUILayout.BeginHorizontal();
3030
EditorGUILayout.LabelField(new GUIContent("Spawn", "Spawns the object across the network"));

MLAPI-Editor/NetworkingManagerEditor.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public override void OnInspectorGUI()
117117
{
118118
Init();
119119
CheckNullProperties();
120-
if (!networkingManager.isServer && !networkingManager.isClient)
120+
if (!networkingManager.IsServer && !networkingManager.IsClient)
121121
{
122122
serializedObject.Update();
123123
EditorGUILayout.PropertyField(DontDestroyOnLoadProperty);
@@ -144,21 +144,21 @@ public override void OnInspectorGUI()
144144
else
145145
{
146146
string instanceType = "";
147-
if (networkingManager.isHost)
147+
if (networkingManager.IsHost)
148148
instanceType = "Host";
149-
else if (networkingManager.isServer)
149+
else if (networkingManager.IsServer)
150150
instanceType = "Server";
151-
else if (networkingManager.isClient)
151+
else if (networkingManager.IsClient)
152152
instanceType = "Client";
153153

154154
EditorGUILayout.HelpBox("You cannot edit the NetworkConfig when a " + instanceType + " is running", UnityEditor.MessageType.Info);
155155
if (GUILayout.Toggle(false, "Stop " + instanceType, EditorStyles.miniButtonMid))
156156
{
157-
if (networkingManager.isHost)
157+
if (networkingManager.IsHost)
158158
networkingManager.StopHost();
159-
else if (networkingManager.isServer)
159+
else if (networkingManager.IsServer)
160160
networkingManager.StopServer();
161-
else if (networkingManager.isClient)
161+
else if (networkingManager.IsClient)
162162
networkingManager.StopClient();
163163
}
164164
}

MLAPI-Editor/TrackedObjectEditor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public override void OnInspectorGUI()
2222
{
2323
Init();
2424
base.OnInspectorGUI();
25-
if(NetworkingManager.singleton != null && NetworkingManager.singleton.isServer)
25+
if(NetworkingManager.Singleton != null && NetworkingManager.Singleton.IsServer)
2626
{
2727
EditorGUILayout.LabelField("Total points: ", trackedObject.TotalPoints.ToString(), EditorStyles.label);
2828
EditorGUILayout.LabelField("Avg time between points: ", trackedObject.AvgTimeBetweenPointsMs.ToString() + " ms", EditorStyles.label);

MLAPI/Data/NetworkPool.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ internal NetworkPool(int prefabId, uint size, ushort poolIndex)
1414
poolId = poolIndex;
1515
for (int i = 0; i < size; i++)
1616
{
17-
GameObject go = MonoBehaviour.Instantiate(NetworkingManager.singleton.NetworkConfig.NetworkedPrefabs[prefabId].prefab, Vector3.zero, Quaternion.identity) as GameObject;
18-
go.GetComponent<NetworkedObject>().isPooledObject = true;
17+
GameObject go = MonoBehaviour.Instantiate(NetworkingManager.Singleton.NetworkConfig.NetworkedPrefabs[prefabId].prefab, Vector3.zero, Quaternion.identity) as GameObject;
18+
go.GetComponent<NetworkedObject>().IsPooledObject = true;
1919
go.GetComponent<NetworkedObject>().PoolId = poolId;
2020
go.GetComponent<NetworkedObject>().Spawn();
2121
go.name = "Pool Id: " + poolId + " #" + i;

MLAPI/Data/NetworkedCollections/NetworkedDictionary.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public NetworkedDictionary(IDictionary<TKey, TValue> value)
7676
public void ResetDirty()
7777
{
7878
dirtyEvents.Clear();
79-
LastSyncedTime = NetworkingManager.singleton.NetworkTime;
79+
LastSyncedTime = NetworkingManager.Singleton.NetworkTime;
8080
}
8181

8282
/// <inheritdoc />
@@ -359,7 +359,7 @@ public bool IsDirty()
359359
if (dirtyEvents.Count == 0) return false;
360360
if (Settings.SendTickrate == 0) return true;
361361
if (Settings.SendTickrate < 0) return false;
362-
if (NetworkingManager.singleton.NetworkTime - LastSyncedTime >= (1f / Settings.SendTickrate)) return true;
362+
if (NetworkingManager.Singleton.NetworkTime - LastSyncedTime >= (1f / Settings.SendTickrate)) return true;
363363
return false;
364364
}
365365

@@ -373,7 +373,7 @@ public TValue this[TKey key]
373373
}
374374
set
375375
{
376-
if (NetworkingManager.singleton.isServer)
376+
if (NetworkingManager.Singleton.IsServer)
377377
dictionary[key] = value;
378378

379379
NetworkedDictionaryEvent<TKey, TValue> dictionaryEvent = new NetworkedDictionaryEvent<TKey, TValue>()
@@ -384,7 +384,7 @@ public TValue this[TKey key]
384384
};
385385
dirtyEvents.Add(dictionaryEvent);
386386

387-
if (NetworkingManager.singleton.isServer && OnDictionaryChanged != null)
387+
if (NetworkingManager.Singleton.IsServer && OnDictionaryChanged != null)
388388
OnDictionaryChanged(dictionaryEvent);
389389
}
390390
}
@@ -404,7 +404,7 @@ public TValue this[TKey key]
404404
/// <inheritdoc />
405405
public void Add(TKey key, TValue value)
406406
{
407-
if (NetworkingManager.singleton.isServer)
407+
if (NetworkingManager.Singleton.IsServer)
408408
dictionary.Add(key, value);
409409

410410
NetworkedDictionaryEvent<TKey, TValue> dictionaryEvent = new NetworkedDictionaryEvent<TKey, TValue>()
@@ -415,14 +415,14 @@ public void Add(TKey key, TValue value)
415415
};
416416
dirtyEvents.Add(dictionaryEvent);
417417

418-
if (NetworkingManager.singleton.isServer && OnDictionaryChanged != null)
418+
if (NetworkingManager.Singleton.IsServer && OnDictionaryChanged != null)
419419
OnDictionaryChanged(dictionaryEvent);
420420
}
421421

422422
/// <inheritdoc />
423423
public void Add(KeyValuePair<TKey, TValue> item)
424424
{
425-
if (NetworkingManager.singleton.isServer)
425+
if (NetworkingManager.Singleton.IsServer)
426426
dictionary.Add(item);
427427

428428
NetworkedDictionaryEvent<TKey, TValue> dictionaryEvent = new NetworkedDictionaryEvent<TKey, TValue>()
@@ -433,14 +433,14 @@ public void Add(KeyValuePair<TKey, TValue> item)
433433
};
434434
dirtyEvents.Add(dictionaryEvent);
435435

436-
if (NetworkingManager.singleton.isServer && OnDictionaryChanged != null)
436+
if (NetworkingManager.Singleton.IsServer && OnDictionaryChanged != null)
437437
OnDictionaryChanged(dictionaryEvent);
438438
}
439439

440440
/// <inheritdoc />
441441
public void Clear()
442442
{
443-
if (NetworkingManager.singleton.isServer)
443+
if (NetworkingManager.Singleton.IsServer)
444444
dictionary.Clear();
445445

446446
NetworkedDictionaryEvent<TKey, TValue> dictionaryEvent = new NetworkedDictionaryEvent<TKey, TValue>()
@@ -449,7 +449,7 @@ public void Clear()
449449
};
450450
dirtyEvents.Add(dictionaryEvent);
451451

452-
if (NetworkingManager.singleton.isServer && OnDictionaryChanged != null)
452+
if (NetworkingManager.Singleton.IsServer && OnDictionaryChanged != null)
453453
OnDictionaryChanged(dictionaryEvent);
454454
}
455455

@@ -480,7 +480,7 @@ public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
480480
/// <inheritdoc />
481481
public bool Remove(TKey key)
482482
{
483-
if (NetworkingManager.singleton.isServer)
483+
if (NetworkingManager.Singleton.IsServer)
484484
dictionary.Remove(key);
485485

486486
TValue value;
@@ -494,7 +494,7 @@ public bool Remove(TKey key)
494494
};
495495
dirtyEvents.Add(dictionaryEvent);
496496

497-
if (NetworkingManager.singleton.isServer && OnDictionaryChanged != null)
497+
if (NetworkingManager.Singleton.IsServer && OnDictionaryChanged != null)
498498
OnDictionaryChanged(dictionaryEvent);
499499

500500
return true;
@@ -504,7 +504,7 @@ public bool Remove(TKey key)
504504
/// <inheritdoc />
505505
public bool Remove(KeyValuePair<TKey, TValue> item)
506506
{
507-
if (NetworkingManager.singleton.isServer)
507+
if (NetworkingManager.Singleton.IsServer)
508508
dictionary.Remove(item);
509509

510510
NetworkedDictionaryEvent<TKey, TValue> dictionaryEvent = new NetworkedDictionaryEvent<TKey, TValue>()
@@ -515,7 +515,7 @@ public bool Remove(KeyValuePair<TKey, TValue> item)
515515
};
516516
dirtyEvents.Add(dictionaryEvent);
517517

518-
if (NetworkingManager.singleton.isServer && OnDictionaryChanged != null)
518+
if (NetworkingManager.Singleton.IsServer && OnDictionaryChanged != null)
519519
OnDictionaryChanged(dictionaryEvent);
520520

521521
return true;

MLAPI/Data/NetworkedCollections/NetworkedList.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public NetworkedList(IList<T> value)
7373
public void ResetDirty()
7474
{
7575
dirtyEvents.Clear();
76-
LastSyncedTime = NetworkingManager.singleton.NetworkTime;
76+
LastSyncedTime = NetworkingManager.Singleton.NetworkTime;
7777
}
7878

7979
/// <inheritdoc />
@@ -82,7 +82,7 @@ public bool IsDirty()
8282
if (dirtyEvents.Count == 0) return false;
8383
if (Settings.SendTickrate == 0) return true;
8484
if (Settings.SendTickrate < 0) return false;
85-
if (NetworkingManager.singleton.NetworkTime - LastSyncedTime >= (1f / Settings.SendTickrate)) return true;
85+
if (NetworkingManager.Singleton.NetworkTime - LastSyncedTime >= (1f / Settings.SendTickrate)) return true;
8686
return false;
8787
}
8888

@@ -382,7 +382,7 @@ IEnumerator IEnumerable.GetEnumerator()
382382
/// <inheritdoc />
383383
public void Add(T item)
384384
{
385-
if (NetworkingManager.singleton.isServer)
385+
if (NetworkingManager.Singleton.IsServer)
386386
list.Add(item);
387387

388388
NetworkedListEvent<T> listEvent = new NetworkedListEvent<T>()
@@ -393,14 +393,14 @@ public void Add(T item)
393393
};
394394
dirtyEvents.Add(listEvent);
395395

396-
if (NetworkingManager.singleton.isServer && OnListChanged != null)
396+
if (NetworkingManager.Singleton.IsServer && OnListChanged != null)
397397
OnListChanged(listEvent);
398398
}
399399

400400
/// <inheritdoc />
401401
public void Clear()
402402
{
403-
if (NetworkingManager.singleton.isServer)
403+
if (NetworkingManager.Singleton.IsServer)
404404
list.Clear();
405405

406406
NetworkedListEvent<T> listEvent = new NetworkedListEvent<T>()
@@ -409,7 +409,7 @@ public void Clear()
409409
};
410410
dirtyEvents.Add(listEvent);
411411

412-
if (NetworkingManager.singleton.isServer && OnListChanged != null)
412+
if (NetworkingManager.Singleton.IsServer && OnListChanged != null)
413413
OnListChanged(listEvent);
414414
}
415415

@@ -428,7 +428,7 @@ public void CopyTo(T[] array, int arrayIndex)
428428
/// <inheritdoc />
429429
public bool Remove(T item)
430430
{
431-
if (NetworkingManager.singleton.isServer)
431+
if (NetworkingManager.Singleton.IsServer)
432432
list.Remove(item);
433433

434434
NetworkedListEvent<T> listEvent = new NetworkedListEvent<T>()
@@ -438,7 +438,7 @@ public bool Remove(T item)
438438
};
439439
dirtyEvents.Add(listEvent);
440440

441-
if (NetworkingManager.singleton.isServer && OnListChanged != null)
441+
if (NetworkingManager.Singleton.IsServer && OnListChanged != null)
442442
OnListChanged(listEvent);
443443

444444
return true;
@@ -459,7 +459,7 @@ public int IndexOf(T item)
459459
/// <inheritdoc />
460460
public void Insert(int index, T item)
461461
{
462-
if (NetworkingManager.singleton.isServer)
462+
if (NetworkingManager.Singleton.IsServer)
463463
list.Insert(index, item);
464464

465465
NetworkedListEvent<T> listEvent = new NetworkedListEvent<T>()
@@ -470,14 +470,14 @@ public void Insert(int index, T item)
470470
};
471471
dirtyEvents.Add(listEvent);
472472

473-
if (NetworkingManager.singleton.isServer && OnListChanged != null)
473+
if (NetworkingManager.Singleton.IsServer && OnListChanged != null)
474474
OnListChanged(listEvent);
475475
}
476476

477477
/// <inheritdoc />
478478
public void RemoveAt(int index)
479479
{
480-
if (NetworkingManager.singleton.isServer)
480+
if (NetworkingManager.Singleton.IsServer)
481481
list.RemoveAt(index);
482482

483483
NetworkedListEvent<T> listEvent = new NetworkedListEvent<T>()
@@ -487,7 +487,7 @@ public void RemoveAt(int index)
487487
};
488488
dirtyEvents.Add(listEvent);
489489

490-
if (NetworkingManager.singleton.isServer && OnListChanged != null)
490+
if (NetworkingManager.Singleton.IsServer && OnListChanged != null)
491491
OnListChanged(listEvent);
492492
}
493493

@@ -501,7 +501,7 @@ public T this[int index]
501501
}
502502
set
503503
{
504-
if (NetworkingManager.singleton.isServer)
504+
if (NetworkingManager.Singleton.IsServer)
505505
list[index] = value;
506506

507507
NetworkedListEvent<T> listEvent = new NetworkedListEvent<T>()
@@ -512,7 +512,7 @@ public T this[int index]
512512
};
513513
dirtyEvents.Add(listEvent);
514514

515-
if (NetworkingManager.singleton.isServer && OnListChanged != null)
515+
if (NetworkingManager.Singleton.IsServer && OnListChanged != null)
516516
OnListChanged(listEvent);
517517
}
518518
}

MLAPI/Data/NetworkedVar.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public T Value
102102
public void ResetDirty()
103103
{
104104
isDirty = false;
105-
LastSyncedTime = NetworkingManager.singleton.NetworkTime;
105+
LastSyncedTime = NetworkingManager.Singleton.NetworkTime;
106106
}
107107

108108
/// <inheritdoc />
@@ -111,7 +111,7 @@ public bool IsDirty()
111111
if (!isDirty) return false;
112112
if (Settings.SendTickrate == 0) return true;
113113
if (Settings.SendTickrate < 0) return false;
114-
if (NetworkingManager.singleton.NetworkTime - LastSyncedTime >= (1f / Settings.SendTickrate)) return true;
114+
if (NetworkingManager.Singleton.NetworkTime - LastSyncedTime >= (1f / Settings.SendTickrate)) return true;
115115
return false;
116116
}
117117

MLAPI/Data/SceneSwitchProgress.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class SceneSwitchProgress
1616
/// <summary>
1717
/// The NetworkTime time at the moment the scene switch was initiated by the server.
1818
/// </summary>
19-
public float TimeAtInitiation { get; } = NetworkingManager.singleton.NetworkTime;
19+
public float TimeAtInitiation { get; } = NetworkingManager.Singleton.NetworkTime;
2020
/// <summary>
2121
/// Delegate type for when the switch scene progress is completed. Either by all clients done loading the scene or by time out.
2222
/// </summary>
@@ -49,7 +49,7 @@ public class SceneSwitchProgress
4949

5050
internal SceneSwitchProgress()
5151
{
52-
timeOutCoroutine = NetworkingManager.singleton.StartCoroutine(NetworkingManager.singleton.TimeOutSwitchSceneProgress(this));
52+
timeOutCoroutine = NetworkingManager.Singleton.StartCoroutine(NetworkingManager.Singleton.TimeOutSwitchSceneProgress(this));
5353
}
5454

5555
internal void AddClientAsDone(uint clientId)
@@ -74,15 +74,15 @@ internal void SetSceneLoadOperation(AsyncOperation sceneLoadOperation)
7474

7575
internal void CheckCompletion()
7676
{
77-
if (!isCompleted && DoneClients.Count == NetworkingManager.singleton.ConnectedClientsList.Count && sceneLoadOperation.isDone)
77+
if (!isCompleted && DoneClients.Count == NetworkingManager.Singleton.ConnectedClientsList.Count && sceneLoadOperation.isDone)
7878
{
7979
isCompleted = true;
8080
isAllClientsDoneLoading = true;
8181
NetworkSceneManager.sceneSwitchProgresses.Remove(guid);
8282
if (OnComplete != null)
8383
OnComplete.Invoke(false);
8484

85-
NetworkingManager.singleton.StopCoroutine(timeOutCoroutine);
85+
NetworkingManager.Singleton.StopCoroutine(timeOutCoroutine);
8686
}
8787
}
8888

MLAPI/Data/Transports/UNET/RelayTransport.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ private enum MessageType
2525
private static ushort port;
2626
private static List<ChannelQOS> channels = new List<ChannelQOS>();
2727

28-
public static bool Enabled => NetworkingManager.singleton.NetworkConfig.RelayEnabled;
29-
public static string RelayAddress => NetworkingManager.singleton.NetworkConfig.RelayAddress;
30-
public static ushort RelayPort => NetworkingManager.singleton.NetworkConfig.RelayPort;
28+
public static bool Enabled => NetworkingManager.Singleton.NetworkConfig.RelayEnabled;
29+
public static string RelayAddress => NetworkingManager.Singleton.NetworkConfig.RelayAddress;
30+
public static ushort RelayPort => NetworkingManager.Singleton.NetworkConfig.RelayPort;
3131

3232
public static int Connect(int hostId, string serverAddress, int serverPort, int exceptionConnectionId, out byte error)
3333
{

0 commit comments

Comments
 (0)