예제 #1
0
    public void PlayerLanded()
    {
        TileTerrain currentTerrain = currentTileMap.GetTile(currentTileMap.WorldToCell(footstepPosition.position)) as TileTerrain;

        if (currentTerrain != null)
        {
            switch (currentTerrain.TerrainType)
            {
            case TileTerrain.TerrainList.Grass:
                //   gm.GetComponent<AudioManager>().PlaySound(AudioManager.SoundList.LandGrass);
                currentSound = AudioManager.SoundList.LandGrass;
                break;

            case TileTerrain.TerrainList.Stone:
                //     gm.GetComponent<AudioManager>().PlaySound(AudioManager.SoundList.LandStone);
                currentSound = AudioManager.SoundList.LandStone;
                break;

            case TileTerrain.TerrainList.Wood:
                //  gm.GetComponent<AudioManager>().PlaySound(AudioManager.SoundList.LandGrass);
                break;
            }
            audioManager.PlaySound(currentSound);
        }
        else
        {
            audioManager.PlaySound(currentSound);
        }
    }
예제 #2
0
    private void checkGroundType()
    {
        TileTerrain currentTerrain = currentTileMap.GetTile(currentTileMap.WorldToCell(footstepPosition.position)) as TileTerrain;

        if (currentTerrain != null)
        {
            switch (currentTerrain.TerrainType)
            {
            case TileTerrain.TerrainList.Grass:
                //gm.GetComponent<AudioManager>().PlaySound(AudioManager.SoundList.StepGrass);
                currentSound = AudioManager.SoundList.StepGrass;
                break;

            case TileTerrain.TerrainList.Stone:
                currentSound = AudioManager.SoundList.StepStone;
                break;

            case TileTerrain.TerrainList.Wood:
                break;
            }
            audioManager.PlaySound(currentSound);
        }
        else
        {
            audioManager.PlaySound(currentSound);
        }
    }