public override void OnDisabled() { foreach (Npc npc in Npc.List) { npc.Kill(false); } Harmony.UnpatchAll(); NavigationNode.Clear(); NodeCondition.Clear(); NodeAction.Clear(); AITarget.Clear(); TargetFilter.Clear(); Handlers.Server.RoundStarted -= EventHandlers.OnRoundStart; Handlers.Server.RoundEnded -= EventHandlers.OnRoundEnd; Handlers.Server.WaitingForPlayers -= EventHandlers.OnWaitingForPlayers; Handlers.Server.RespawningTeam -= EventHandlers.OnTeamRespawning; Handlers.Player.Dying -= EventHandlers.OnDying; Handlers.Player.EnteringPocketDimension -= EventHandlers.OnEnteringPocketDim; Handlers.Player.Hurting -= EventHandlers.OnHurt; Handlers.Map.ExplodingGrenade -= EventHandlers.OnGrenadeExplosion; Handlers.Map.Decontaminating -= EventHandlers.OnDecontamination; Handlers.Warhead.Starting -= EventHandlers.OnWarheadStart; EventHandlers = null; Random = null; Harmony = null; Instance = null; }
// ------------------------------------------------------------------- // Name : ClearTarget // Desc : Clears the current target // ------------------------------------------------------------------- public void ClearTarget() { _target.Clear(); if (_targetTrigger != null) { _targetTrigger.enabled = false; } }
public override void OnReloaded() { NavigationNode.Clear(); NodeCondition.Clear(); NodeAction.Clear(); AITarget.Clear(); TargetFilter.Clear(); }
// Clearing the target public void ClearTarget() { _target.Clear(); // When we clear the target, we clear the target trigger too if (_targetTrigger.enabled) { _targetTrigger.enabled = false; } }
// Clears the audio and visual threats each update and re-calculates the distance to the current target protected virtual void FixedUpdate() { visualThreat.Clear(); audioThreat.Clear(); if (_target.type != AITargetType.None) { _target.distance = Vector3.Distance(transform.position, _target.position); } }
// ------------------------------------------------------------------- // Name : FixedUpdate // Desc : Called by Unity with each tick of the Physics system. It // clears the audio and visual threats each update and // re-calculates the distance to the current target // -------------------------------------------------------------------- protected virtual void FixedUpdate() { VisualThreat.Clear(); AudioThreat.Clear(); if (_target.type != AITargetType.None) { _target.distance = Vector3.Distance(_transform.position, _target.position); } _isTargetReached = false; }
protected virtual void FixedUpdate() { // Clear both visual and audio threats to keep things updated VisualThreat.Clear(); AudioThreat.Clear(); // Update the distance to the target if (_target.type != AITargetType.None) { _target.distance = Vector3.Distance(transform.position, _target.position); } _isTargetReached = false; }
protected virtual void FixedUpdate() { // Cancella le minacce audio e visive ad ogni Update e // ricalcola la distanza dal target attuale VisualThreat.Clear(); AudioThreat.Clear(); if (_target.type != AITargetType.None) { _target.distance = Vector3.Distance(_transform.position, _target.position); } _isTargetReached = false; }