void Awake() { if (AmbientMusic.instance != null) { Destroy(gameObject); return; } AmbientMusic.instance = this; }
void Awake() { _bCountdown = true; SetRoundTime(); _ambient = GetComponentInChildren <AmbientMusic>(); Instance = this; }
public override void Init() { StaticSceneObjects.Clear(); NonStaticSceneObjects.Clear(); LightPosition = new TGCVector3(0, 80000, -6 * skyBoxDimensions.X); lightBox = TGCBox.fromSize(TGCVector3.One * 500, Color.Red); lightBox.Transform = TGCMatrix.Translation(LightPosition); InitFog(); InitMainMeshes(); InitHUD(); LoadMainScene(); ManageFocus(); spawnManager = new SpawnManager(this); SetCamera(); //DirectSound.ListenerTracking = Player.Meshes[0]; // Alguno de los meshes del player, cumplen con la interfaz ITransformObject LightPosition = new TGCVector3(0, 8000, -5 * heightMaps[0].XZRadius); lightBox = TGCBox.fromSize(TGCVector3.One * 500, Color.Red); lightBox.Transform = TGCMatrix.Translation(LightPosition); ScenesQuadTree.create(StaticSceneObjects, new TgcBoundingAxisAlignBox(SueloDelMar.centre - new TGCVector3(SueloDelMar.XZRadius, 3000, SueloDelMar.XZRadius), SueloDelMar.centre + new TGCVector3(SueloDelMar.XZRadius, 5000, SueloDelMar.XZRadius))); ScenesQuadTree.createDebugQuadTreeMeshes(); InitFullQuadVB(); InitAuxRenderTarget(); InitGogleViewEffectResources(); InitSounds(); InitBubbleEmitter(); InPrincipalMenu = true; FocusInGame = false; MouseEnable(); AmbientMusic.play(true); }
private void InitSounds() { sounds.Clear(); AmbientMusic.loadSound(MediaDir + "//Sounds//InterstellarSoundtrack.wav", DirectSound.DsDevice); sounds.Add(AmbientMusic); OnHitPlayerSound.loadSound(MediaDir + "//Sounds//GolpeAPlayer.wav", DirectSound.DsDevice); sounds.Add(OnHitPlayerSound); OutOfOxygenSound.loadSound(MediaDir + "//Sounds//SinOxigeno.wav", DirectSound.DsDevice); sounds.Add(OutOfOxygenSound); OpenCraftingMenu.loadSound(MediaDir + "//Sounds//AbrirMenuCrafteo.wav", DirectSound.DsDevice); sounds.Add(OpenCraftingMenu); EatingSound.loadSound(MediaDir + "//Sounds//Comer.wav", DirectSound.DsDevice); sounds.Add(EatingSound); EquipItemSound.loadSound(MediaDir + "//Sounds//EquiparItem.wav", DirectSound.DsDevice); sounds.Add(EquipItemSound); UnderwaterAmbience.loadSound(MediaDir + "//Sounds//AmbienteBajoElAgua.wav", DirectSound.DsDevice); sounds.Add(UnderwaterAmbience); SurfaceAmbience.loadSound(MediaDir + "//Sounds//AmbienteFueraDelAgua.wav", DirectSound.DsDevice); sounds.Add(SurfaceAmbience); CraftingFailSound.loadSound(MediaDir + "//Sounds//ErrorConstruccion.wav", DirectSound.DsDevice); sounds.Add(CraftingFailSound); BreathingSound.loadSound(MediaDir + "//Sounds//RespiracionProfunda.wav", DirectSound.DsDevice); sounds.Add(BreathingSound); BoublesSound.loadSound(MediaDir + "//Sounds//Burbujas.wav", DirectSound.DsDevice); sounds.Add(BoublesSound); CoralpickupSound.loadSound(MediaDir + "//Sounds//RecolectarCoral.wav", DirectSound.DsDevice); sounds.Add(CoralpickupSound); TgcStaticSound hit1 = new TgcStaticSound(); hit1.loadSound(MediaDir + "//Sounds//Golpe1.wav", DirectSound.DsDevice); TgcStaticSound hit2 = new TgcStaticSound(); hit2.loadSound(MediaDir + "//Sounds//Golpe2.wav", DirectSound.DsDevice); OnHitNpcSounds.Clear(); OnHitNpcSounds.Add(hit1); OnHitNpcSounds.Add(hit2); sounds.AddRange(OnHitNpcSounds); TgcStaticSound crafting1 = new TgcStaticSound(); crafting1.loadSound(MediaDir + "//Sounds//Construir1.wav", DirectSound.DsDevice); TgcStaticSound crafting2 = new TgcStaticSound(); crafting2.loadSound(MediaDir + "//Sounds//Construir2.wav", DirectSound.DsDevice); CraftingSounds.Clear(); CraftingSounds.Add(crafting1); CraftingSounds.Add(crafting2); sounds.AddRange(CraftingSounds); }