Skip to content

Commit d705c48

Browse files
committed
Adding comments
1 parent 19cdd8b commit d705c48

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

Packages/com.unity.multiplayer.samples.coop/Utilities/SceneManagement/LoadingProgressManager.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,16 @@ public class LoadingProgressManager : NetworkBehaviour
1414
[SerializeField]
1515
GameObject m_ProgressTrackerPrefab;
1616

17+
/// <summary>
18+
/// Dictionary containing references to the NetworkedLoadingProgessTrackers that contain the loading progress of
19+
/// each client. Keys are ClientIds.
20+
/// </summary>
1721
public Dictionary<ulong, NetworkedLoadingProgressTracker> ProgressTrackers { get; } = new Dictionary<ulong, NetworkedLoadingProgressTracker>();
1822

23+
/// <summary>
24+
/// This is the AsyncOperation of the current load operation. This property should be set each time a new
25+
/// loading operation begins.
26+
/// </summary>
1927
public AsyncOperation LocalLoadOperation
2028
{
2129
set
@@ -28,8 +36,16 @@ public AsyncOperation LocalLoadOperation
2836
AsyncOperation m_LocalLoadOperation;
2937

3038
float m_LocalProgress;
39+
40+
/// <summary>
41+
/// This event is invoked each time the dictionary of progress trackers is updated (if one is removed or added, for example.)
42+
/// </summary>
3143
public event Action onTrackersUpdated;
3244

45+
/// <summary>
46+
/// The current loading progress for the local client. Handled by a local field if not in a networked session,
47+
/// or by a progress tracker from the dictionary.
48+
/// </summary>
3349
public float LocalProgress
3450
{
3551
get => IsSpawned && ProgressTrackers.ContainsKey(NetworkManager.LocalClientId) ?

Packages/com.unity.multiplayer.samples.coop/Utilities/SceneManagement/NetworkedLoadingProgressTracker.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
namespace Unity.Multiplayer.Samples.Utilities
44
{
55
/// <summary>
6-
/// Simple object that keeps track of the scene loading progress of a specific instance
6+
/// Simple object that keeps track of the scene loading progress of a specific instance.
77
/// </summary>
88
public class NetworkedLoadingProgressTracker: NetworkBehaviour
99
{
10-
NetworkVariable<float> m_Progress = new NetworkVariable<float>(0, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Owner);
11-
12-
public NetworkVariable<float> Progress => m_Progress;
13-
10+
/// <summary>
11+
/// The current loading progress associated with the owner of this NetworkBehavior
12+
/// </summary>
13+
public NetworkVariable<float> Progress { get; } = new NetworkVariable<float>(0, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Owner);
1414
}
1515
}

0 commit comments

Comments
 (0)