本文整理汇总了C#中Zone.OnEntityKill方法的典型用法代码示例。如果您正苦于以下问题:C# Zone.OnEntityKill方法的具体用法?C# Zone.OnEntityKill怎么用?C# Zone.OnEntityKill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zone
的用法示例。
在下文中一共展示了Zone.OnEntityKill方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnBuildingExitZone
private void OnBuildingExitZone(Zone zone, BaseCombatEntity entity)
{
HashSet<Zone> zones;
if (buildingZones.TryGetValue(entity, out zones))
{
zone.OnEntityKill(entity);
if (!zones.Remove(zone)) return;
if (zones.Count <= 0) buildingZones.Remove(entity);
}
if (HasZoneFlag(zone, ZoneFlags.NoStability))
{
var block = entity as BuildingBlock;
if (block == null) return;
var prefab = GameManager.server.FindPrefab(block.blockDefinition.fullName);
block.grounded = prefab.GetComponent<BuildingBlock>()?.grounded ?? false;
}
//Puts("OnBuildingExitZone: {0}", entity.GetType());
}
示例2: OnPlayerExitZone
private void OnPlayerExitZone(Zone zone, BasePlayer player)
{
HashSet<Zone> zones;
if (playerZones.TryGetValue(player, out zones))
{
zone.OnEntityKill(player);
if (!zones.Remove(zone)) return;
if (zones.Count <= 0) playerZones.Remove(player);
}
UpdateFlags(player);
if (!string.IsNullOrEmpty(zone.Info.leave_message))
{
if (PopupNotifications != null && usePopups)
PopupNotifications.Call("CreatePopupNotification", string.Format(zone.Info.leave_message, player.displayName), player);
else
SendMessage(player, zone.Info.leave_message, player.displayName);
}
if (zone.KeepInList.Contains(player.userID)) AttractPlayer(zone, player);
Interface.Oxide.CallHook("OnExitZone", zone.Info.ID, player);
//Puts("OnPlayerExitZone: {0}", player.GetType());
}