car occlusion, space ambience done
This commit is contained in:
@@ -8,11 +8,16 @@ public class SpaceEnterCollider : MonoBehaviour
|
||||
{
|
||||
public GameObject InstructionText;
|
||||
|
||||
private EventInstance PortalEntrance;
|
||||
private EventInstance PortalEntrance;
|
||||
private EventInstance SpaceMusic;
|
||||
|
||||
private bool musicStarted = false;
|
||||
private void Awake()
|
||||
{
|
||||
PortalEntrance = AudioManager.Instance.CreateInstance(FMODEvents.Instance.PortalEnter);
|
||||
|
||||
SpaceMusic = AudioManager.Instance.CreateInstance(FMODEvents.Instance.Kosmos);
|
||||
SpaceMusic.setParameterByName("KosmosMusicVolume", 1.0f);
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
@@ -46,6 +51,15 @@ public class SpaceEnterCollider : MonoBehaviour
|
||||
|
||||
PortalEntrance.start();
|
||||
|
||||
if (!musicStarted)
|
||||
{
|
||||
SpaceMusic.start();
|
||||
musicStarted = true;
|
||||
}
|
||||
|
||||
// Fade music in on entering
|
||||
SpaceMusic.setParameterByName("KosmosMusicVolume", 0f);
|
||||
|
||||
}
|
||||
|
||||
private void OnTriggerExit(Collider other)
|
||||
@@ -63,7 +77,8 @@ public class SpaceEnterCollider : MonoBehaviour
|
||||
Debug.Log(other + " left space.");
|
||||
|
||||
PortalEntrance.start();
|
||||
|
||||
// Fade music out on leaving
|
||||
SpaceMusic.setParameterByName("KosmosMusicVolume", 1.0f);
|
||||
}
|
||||
|
||||
private IEnumerator DelayExit(GravityHandler playerGravity)
|
||||
|
||||
Reference in New Issue
Block a user