Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

사운드 (플레이어 데미지 입는 경우 사운드, 배경 사운드) 추가 #5

Open
wants to merge 1 commit into
base: A_planet_ver1
Choose a base branch
from

Conversation

sukyeongs
Copy link
Member

@sukyeongs sukyeongs commented May 23, 2023

플레이어가 데미지를 입을 때 나올 사운드와 배경 사운드 추가했습니다.

1. 플레이어 데미지 사운드

Attack Jump & Hit Damage Human Sounds : 데미지를 입을 경우 플레이어가 내는 소리 에셋

Player.cs

public class Player : MonoBehaviour
{
    public AudioClip hitSound;  // sound when player is damaged
    private AudioSource hurtAudioPlayer;  // audio source component

    public void Awake()
    {
        // get using component from game object
        hurtAudioPlayer = GetComponent<AudioSource>();
    }

    public void OnDamage(float damage, Vector3 hitPoint, Vector3 hitNormal)
    {
        if (!dead)  // if player isn't dead
        {
            hurtAudioPlayer.PlayOneShot(hitSound);
        }
    }
}

사용자가 죽지 않고 데미지를 입을 경우 데미지 입는 소리를 내도록 Player.cs에 관련 코드 추가

2. 배경 사운드

Space Ambient Album - 101218 : 우주 배경 음악

추후에 사용할 일이 있을 것 같아, 전체 에셋을 push 했습니다!
6월2일 회의에서 같이 배경음악 선정하면 좋을 것 같습니다.

@sukyeongs sukyeongs added the enhancement New feature or request label May 23, 2023
@sukyeongs sukyeongs self-assigned this May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant