public AudioClip[] GetSounds(eSound _sound)
    {
        switch (_sound)
        {
        case eSound.BackgroundLoops: return(backgroundAudio);

        case eSound.CharacterHurt: return(ouchAudio);

        case eSound.CharacterJump: return(jumpAudio);

        case eSound.CharacterWalk: return(walkAudio);

        case eSound.CharacterLandOnEnemy: return(landOnEnemyAudio);

        case eSound.CharacterLandOnGround: return(landOnGroundAudio);

        case eSound.CharacterRespawn: return(respawnAudio);

        case eSound.PickupCollectable: return(pickupCollectableAudio);

        default:
            Debug.LogError("Unknown sound");
            return(null);
        }
    }
 // Called when the node enters the scene tree for the first time.
 public override void _Ready()
 {
     _screenSize = GetViewport().GetSize();
     movesound   = globals.engine.loadSound("sounds/move.ogg");
     GetNode <CollisionShape2D>("CollisionShape2D").Disabled = true;
     Hide();
 }
    public string GetSoundPath(eSound _sound)
    {
        switch (_sound)
        {
        case eSound.BackgroundLoops: return("background_loops");

        case eSound.CharacterHurt: return("character_hurt");

        case eSound.CharacterJump: return("character_jump");

        case eSound.CharacterLandOnEnemy: return("character_land_on_enemy");

        case eSound.CharacterLandOnGround: return("character_land_on_ground");

        case eSound.CharacterRespawn: return("character_respawn");

        case eSound.CharacterWalk: return("character_walk");

        case eSound.PickupCollectable: return("pickup_collectable");

        default:
            Debug.LogError("Unknown sound");
            return(null);
        }
    }
Beispiel #4
0
 // Called when the node enters the scene tree for the first time.
 public override void _Ready()
 {
     desksound                = Globals.engine.loadSound("sounds/desk.ogg");
     surface                  = GetNode <CSGBox>("surface");
     deskinstance             = desksound.play3d(Transform.origin.x, Transform.origin.y, Transform.origin.z, loopMode.simpleLoop);
     deskinstance.maxDistance = 50;
     deskinstance.minDistance = 0.1f;
 }
Beispiel #5
0
    public void PlaySound(eSound sound)
    {
        SoundData soundData = Sound.Find(data => data.Sound == sound);

        if (soundData != null)
        {
            AudioSource_Sound.PlayOneShot(soundData.AudioClip);
        }
    }
 // Called when the node enters the scene tree for the first time.
 public override void _Ready()
 {
     Head           = GetNode <Spatial>("Head");
     GroundCheck    = GetNode <RayCast>("GroundCheck");
     collisionTimer = GetNode <Timer>("walltimer");
     jumpsound      = Globals.engine.loadSound("sounds/duck.ogg");
     wallsound      = Globals.engine.loadSound("sounds/wall.ogg");
     Input.SetMouseMode(Input.MouseMode.Captured);
 }
Beispiel #7
0
 public void PlaySound(eSound soundName)
 {
     AudioClipSound = null;
     AudioClipSound = Resources.Load <AudioClip>("Music/Sound/" + soundName.ToString());
     if (AudioClipSound != null)
     {
         AudioSourceSound.PlayOneShot(AudioClipSound);
     }
 }
Beispiel #8
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch      = new SpriteBatch(GraphicsDevice);
            this.sonido      = engine.loadSound("beam.mp3");
            this.instancia   = this.sonido.play3d(0, 0, 0, loopMode.bidiLoop);
            this.yoshimusic  = engine.loadMusic("yoshi.mp3");
            this.fossilMusic = engine.loadMusic("fossil.mp3");


            // TODO: use this.Content to load your game content here
        }
    public static void PlayRandomSound(eSound _sound, AudioSource _source = null)
    {
        if (_source == null)
        {
            _source = instance.playerSource;
        }
        var clips = instance.GetSounds(_sound);

        if (clips != null && clips.Length > 0)
        {
            _source.PlayOneShot(clips.Random());
        }
    }
Beispiel #10
0
    public void PlaySound(eSound enumS, int loop)
    {
        AndroidNativeAudio.setVolume(SoundID[(int)enumS], GameManager.Instance.AudioVolume);
        SoundID[(int)enumS] = AndroidNativeAudio.play(FileID[(int)enumS], GameManager.Instance.AudioVolume);
        AndroidNativeAudio.setVolume(SoundID[(int)enumS], GameManager.Instance.AudioVolume);

        AndroidNativeAudio.setLoop(SoundID[(int)enumS], loop);
        //for (int i = 0; i < System.Enum.GetValues(typeof(eSound)).Length; i++)
        //{
        //    SoundID[i] = AndroidNativeAudio.play(FileID[i]);
        //}
        //Debug.Log("GameManager.Instance.AudioVolume" + GameManager.Instance.AudioVolume);
    }
Beispiel #11
0
 public void playstep()
 {
     stepsound    = Globals.engine.loadSound("sounds/carpet/" + random.Next(1, 9) + ".ogg");
     stepinstance = stepsound.play(0, loopMode.noLoop);
 }
Beispiel #12
0
 public static string toString(eSound s)
 {
     return(s.ToString());
 }
Beispiel #13
0
 // Called when the node enters the scene tree for the first time.
 public override void _Ready()
 {
     voicesound                = globals.engine.loadSound("sounds/" + _mobTypes[_random.Next(0, _mobTypes.Length)] + ".mp3");
     voiceinstance             = voicesound.play3d(Position.x, 0, Position.y, loopMode.simpleLoop);
     voiceinstance.maxDistance = 5000;
 }
Beispiel #14
0
 public void PlaySound(eSound sound)
 {
     soundEffects[(int)sound].Play();
 }
 public void PlaySoundEffect(eSound index)
 {
     Debug.Log("PlaySoundEffect : " + index);
     audioSourceSE.PlayOneShot(audioClips[(int)index]);
 }
Beispiel #16
0
 // Called when the node enters the scene tree for the first time.
 public override void _Ready()
 {
     gameoversound = globals.engine.loadSound("sounds/gameover.mp3");
     gamemusic     = globals.engine.loadMusic("sounds/34 Docaty Mountain Railroad.mp3");
 }