public void RequestForSoundResolve(AgentSoundComponent a, SoundType t) { if (!ReceivedSoundQueue.Contains(a)) { ReceivedSoundQueue.Enqueue(a); ReceivedSoundType.Enqueue(t); } }
private void ResolveSoundReceive() { while (ReceivedSoundQueue.Count > 0) { AgentSoundComponent a = ReceivedSoundQueue.Dequeue(); SoundType t = ReceivedSoundType.Dequeue(); List <PointIntensity> trace = TrackSoundSource(a.transform.position, a.agent.radius, t); a.DrawTrackToSoundSource(trace); } if (ReceivedSoundType.Count > 0) { Debug.Log("received sound type queue is not cleared"); } }
private void CheckHitTarget(GameObject obj, SoundType t, GameObject source) { // prevent the case when a agent receive its own sound if (obj == source) { return; } //pass in sound type heard AgentSoundComponent cpnt = obj.GetComponent <AgentSoundComponent>(); if (cpnt) { //cpnt.ReceiveSound(gameObject, intensity); cpnt.ReceiveSound(t); } }
public void UnregisterAgent(AgentSoundComponent agent) { agents.Remove(agent); }
public void RegisterAgent(AgentSoundComponent agent) { agents.Add(agent); }