11using MLAPI . MonoBehaviours . Core ;
2+ using System . Collections ;
23using System . Collections . Generic ;
34using UnityEngine ;
45
@@ -7,8 +8,8 @@ namespace MLAPI.MonoBehaviours.Prototyping
78 /// <summary>
89 /// A prototype component to set observers based on distance
910 /// </summary>
10- [ AddComponentMenu ( "MLAPI/NetworkedProximity " ) ]
11- public class NetworkedProximity : NetworkedBehaviour
11+ [ AddComponentMenu ( "MLAPI/NetworkedProximity2 " ) ]
12+ public class NetworkedProximity2 : NetworkedBehaviour
1213 {
1314 /// <summary>
1415 /// Method to use for checking distance
@@ -55,32 +56,20 @@ public enum CheckMethod
5556 public CheckMethod CheckType = CheckMethod . Physics3D ;
5657
5758 /// <summary>
58- /// Specifies whether this query should hit Triggers.
59+ /// Specifies whether this query should hit Triggers (Physics3D only .
5960 /// </summary>
6061 [ Tooltip ( "Specifies whether this query should hit Triggers (Physics3D only)." ) ]
6162 public QueryTriggerInteraction queryTriggerInteraction3D = QueryTriggerInteraction . UseGlobal ;
6263
6364 /// <summary>
64- /// Min / Max depth range (2D only).
65+ /// Min / Max depth range (Physics2D only).
6566 /// </summary>
6667 [ Tooltip ( "Min / Max depth range (Physics2D only)." ) ]
6768 public Depth2D depth2D ;
6869
6970 /// <summary>
7071 private float lastUpdateTime ;
7172
72- //private void FixedUpdate()
73- //{
74- // if (!isServer)
75- // return;
76-
77- // if (Time.time - lastUpdateTime > VisibilityUpdateInterval)
78- // {
79- // RebuildObservers();
80- // lastUpdateTime = NetworkingManager.singleton.NetworkTime;
81- // }
82- //}
83-
8473 /// <summary>
8574 /// Called when a new client connects
8675 /// </summary>
@@ -165,20 +154,20 @@ public override bool OnRebuildObservers(HashSet<uint> observers)
165154 return false ;
166155 }
167156 }
168- }
169157
170- [ System . Serializable ]
171- public class Depth2D
172- {
173- /// <summary>
174- /// Only include objects with a Z coordinate (depth) greater than or equal to this value.
175- /// </summary>
176- [ Tooltip ( "Only include objects with a Z coordinate (depth) greater than or equal to this value." ) ]
177- public float minDepth = - Mathf . Infinity ;
158+ [ System . Serializable ]
159+ public class Depth2D
160+ {
161+ /// <summary>
162+ /// Only include objects with a Z coordinate (depth) greater than or equal to this value.
163+ /// </summary>
164+ [ Tooltip ( "Only include objects with a Z coordinate (depth) greater than or equal to this value." ) ]
165+ public float minDepth = - Mathf . Infinity ;
178166
179- /// <summary>
180- /// Only include objects with a Z coordinate (depth) less than or equal to this value.
181- /// </summary>
182- [ Tooltip ( "Only include objects with a Z coordinate (depth) less than or equal to this value." ) ]
183- public float maxDepth = Mathf . Infinity ;
167+ /// <summary>
168+ /// Only include objects with a Z coordinate (depth) less than or equal to this value.
169+ /// </summary>
170+ [ Tooltip ( "Only include objects with a Z coordinate (depth) less than or equal to this value." ) ]
171+ public float maxDepth = Mathf . Infinity ;
172+ }
184173}
0 commit comments