Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
 // -------------------------------------------------------------------
 // Name :   ClearTarget
 // Desc :   Clears the current target
 // -------------------------------------------------------------------
 public void ClearTarget()
 {
     _target.Clear();
     if (_targetTrigger != null)
     {
         _targetTrigger.enabled = false;
     }
 }
Ejemplo n.º 3
0
 public override void OnReloaded()
 {
     NavigationNode.Clear();
     NodeCondition.Clear();
     NodeAction.Clear();
     AITarget.Clear();
     TargetFilter.Clear();
 }
Ejemplo n.º 4
0
 // 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;
     }
 }
Ejemplo n.º 5
0
    // 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);
        }
    }
Ejemplo n.º 6
0
    // -------------------------------------------------------------------
    // 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;
    }
Ejemplo n.º 7
0
    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;
    }
Ejemplo n.º 8
0
    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;
    }