private void OnPlayerDisconnected(Player player) { if (!WatcherEnabled) { return; } var message = string.Format(Left, player.Name); if (LogToConsole) { Log(message); } if (!LeaveEnabled) { return; } if (HideList.Contains(player.Id.ToString())) { return; } if (ShowChatPrefixW) { message = $"[{ChatPrefixColor}]{ChatPrefix}[FFFFFF]: {message}"; } PrintToChat(message); }
private void OnPlayerConnected(Player player) { if (player.Name == "Server" && player.Id == 9999999999) { return; } if (!WatcherEnabled) { return; } var message = string.Format(Joined, player.Name); if (LogToConsole) { Log(message); } if (!JoinEnabled) { return; } if (HideList.Contains(player.Id.ToString())) { return; } if (ShowChatPrefixW) { message = $"[{ChatPrefixColor}]{ChatPrefix}[FFFFFF]: {message}"; } PrintToChat(message); }
public Vector3 CalculateHidingPlace(BehaviourContext context, Vector3 enemy_Position) { float closestDistanceSqr = float.MaxValue; _hidingPlace = context._position; _hidingPlaces = new HideList(); for (int i = 0; i < _colliders.Count; i++) { Vector3 hidingPlace = CalculateHidingPlace(context, _colliders[i], enemy_Position); _hidingPlaces.Add(hidingPlace); float distanceToHidingPlace = (context._position - hidingPlace).sqrMagnitude; if (distanceToHidingPlace < closestDistanceSqr) { closestDistanceSqr = distanceToHidingPlace; _hidingPlace = hidingPlace; } } return(_hidingPlace); }