Ejemplo n.º 1
0
    private void _OnBodyExited(object body)
    {
        //Decrement number of bodies
        Bodies -= 1;

        //Search for GroundSound Node. If found, update sound library.
        GroundSound groundSound = NX.Find <GroundSound>((Node)body);

        if (groundSound != null && groundSound == OverlappedGroundSounds[groundSound.Priority])
        {
            OverlappedGroundSounds.Remove(groundSound.Priority);
            UpdateAudioPlayers();
        }
    }
Ejemplo n.º 2
0
    private void _OnBodyEntered(object body)
    {
        //Increment number of bodies
        Bodies += 1;

        //Search for GroundSound Node. If found, update sound library.
        GroundSound groundSound = NX.Find <GroundSound>((Node)body);

        if (groundSound != null)
        {
            if (!OverlappedGroundSounds.ContainsKey(groundSound.Priority))
            {
                OverlappedGroundSounds.Add(groundSound.Priority, groundSound);
                UpdateAudioPlayers();
            }
            else
            {
                OverlappedGroundSounds[groundSound.Priority] = groundSound;
            }
        }
        //Allow character to bunny hop again
        CanBunnyHop = true;
    }