August 2018
Beginner
334 pages
10h 19m
English
We will create the SoundReceiver class for our agents, and SoundEmitter for things such as alarms:
using UnityEngine;
using System.Collections;
public class SoundReceiver : MonoBehaviour
{
public float soundThreshold;
}
public virtual void Receive(float intensity, Vector3 position)
{
// TODO
// code your own behaviour here
}
using UnityEngine; using System.Collections; using System.Collections.Generic; public class SoundEmitter : MonoBehaviour { public float soundIntensity; public float soundAttenuation; public GameObject emitterObject; ...Read now
Unlock full access