Esempio n. 1
0
 private void Awake()
 {
     effectsModifier    = Camera.main.GetComponent <EffectsModifier>();
     humanSoundBehavior = GetComponent <HumanSoundBehavior>();
     audioSource        = GetComponent <AudioSource>();
     waveSoundManager   = FindObjectOfType <WaveSoundManager>();
     waveSoundManager.AssingClip(audioSource, clips[Random.Range(0, clips.Length)]);
     startIntensity = 1.0f / newIntensity;
 }
Esempio n. 2
0
        public void InstantiateSound()
        {
            Vector3            pos       = transform.position + Random.insideUnitSphere * spawnRadius;
            HumanSoundBehavior agentInst = Instantiate(humanSoundBehavior, pos, Quaternion.identity);

            agentInst.transform.parent = gameObject.transform;

            timer     = 0.0f;
            spawnTime = Random.Range(minTimeBetweenSpawn, maxTimeBetweenSpawn);
        }