Esempio n. 1
0
    private void EmitSound()
    {
        CreaturesInSoundEmissionRadius = Physics.OverlapSphere(transform.position, CurrentSoundEmissionRadius, CreatureLayerMask);

        foreach (Collider CreatureCollider in CreaturesInSoundEmissionRadius)
        {
            Agent agent = CreatureCollider.GetComponent <Agent>();
            if (agent.IsThinking)
            {
                agent.Perception.PerceptionSound.ReceiveData(transform);
            }
        }
    }
Esempio n. 2
0
    //Pour faire connaitre notre présence au allié même si on bouge pas
    public void EmitSoundForFriend()
    {
        CreaturesInSoundEmissionRadius = Physics.OverlapSphere(owner.transform.position, MaxSoundEmissionRadius, CreatureLayerMask);

        foreach (Collider CreatureCollider in CreaturesInSoundEmissionRadius)
        {
            Agent agent = CreatureCollider.GetComponent <Agent>();
            if (agent != owner && agent.IsThinking && agent.Creature.SpecieID == owner.Creature.SpecieID)
            {
                agent.Perception.PerceptionSound.ReceiveData(owner.transform);
            }
        }
    }