public override void SimulateOwner() { if (BoltNetwork.frame % 30 == 0 && BoltNetwork.scopeMode == ScopeMode.Manual && base.enabled && base.entity.controller != null) { BoltPOI.UpdateScope(this, base.entity.controller); } }
public override void SimulateOwner() { if (((BoltNetwork.frame % 30) == 0) && (BoltNetwork.scopeMode == Bolt.ScopeMode.Manual) && enabled) { if (entity.controller != null) { BoltPOI.UpdateScope(this, entity.controller); } } }
public static void UpdateScope(BoltAOI aoi, BoltConnection connection) { Vector3 position = aoi.transform.position; float detectRadius = aoi.detectRadius; float releaseRadius = aoi.releaseRadius; for (int i = 0; i < BoltPOI.availablePOIs.Count; i++) { BoltPOI boltPOI = BoltPOI.availablePOIs[i]; Vector3 position2 = boltPOI.transform.position; float bRadius = boltPOI.radius; if (BoltPOI.OverlapSphere(position, position2, detectRadius, bRadius)) { boltPOI.entity.SetScope(connection, true); } else if (!BoltPOI.OverlapSphere(position, position2, releaseRadius, bRadius)) { boltPOI.entity.SetScope(connection, false); } } }