#1
ํ ์คํธ๊ฐ ๋น์ ์ํฅ์ ๋ฐ๊ฒ ํ ๋ ค๋ฉด ์์ด๋๋ฅผ ์ด๋ป๊ฒ ์ง์ผํ๋.. ํ๊ณ ๊ณ ๋ฏผํ๋ ์ค,ย ๊ทธ๋ฅ ํฌ๊ธฐํ๊ณ ๊ฑ ํ ์คํธ๊ฐ ๊ธฐ์ ๋ ํ ์ค์ณ๋ฅผ ์์ ์๋ก ๋ง๋ค์.
์ ๋ํฐ๋ ๊ธฐ๋ณธ์ ์ผ๋ก ๊ทธ๋ฐ ๊ธฐ๋ฅ์ ๋ฃ์ด์ผ๊ฒ ๋ค๋ ์๊ฐ์ ํ๋ฒ๋ ์ํด๋ณธ ๊ฑธ๊น?
#2
Project Nightmare Simulator development diary #2
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class player_step : MonoBehaviour
{
public AudioSource stepaudio;
public AudioClip rockstep;
public AudioClip rockstep2;
// Use this for initialization
void Start()
{
stepaudio = GetComponent<AudioSource>();
}
// Update is called once per frame
void Update()
{
}
void OnCollisionEnter (Collision col)
{
if (col.gameObject.tag == "G_rock")
{
stepaudio.clip = rockstep;
stepaudio.pitch = 1f;
}
if (col.gameObject.tag == "G_wood")
{
stepaudio.clip = rockstep;
stepaudio.pitch = 0.63f;
}
if (col.gameObject.tag == "G_rock2")
{
stepaudio.clip = rockstep2;
stepaudio.pitch = 1f;
}
}
}
--
Totally simple foot step sound base code.
However if the foot step system goes dynamic, RIP to codeย
:(
์์ ํ ๊ฐ๋จํ๊ฒ ์ง๋์ ๋ฐ์๋ฆฌ ์ฝ๋.
์ ๊ณต์๊ฐ ๋ณด๋ฉด ๋จธ๋ฆฌ๋ฅผ ํ๋ ํ๋ ค๊ฐ๊ธธ ์ฝ๋๋ผ๊ณ ์ ํด์ง๋ค๊ณ ํ๋ค.
--
์ผ๋จ ํ๋ฒ ์ฒ์์ผ๋ก ๊ฐ๋ฐ์ผ์ง ๊ฐ์ ๊ฑธ ์จ๋ดค๋๋ฐ, ์ด๋ ๊ฒ ์ฐ๋ ๊ฒ ๋ง๋์ง ๋ชจ๋ฅด๊ฒ ์.
ํ์ด์ค๋ถ ์์ํ ๊ธฐ๋ ์ผ๋ก ์คํ๋์ค(ํ๋ช ๋ฟ์ด์ง๋ง ํ์ด์ง ์ด๋ฆ์ ์ ํด์ผํด์.. ๊ฑ ์ผ๋จ ์ด๋ฆ์ด๋ผ๋ ๋ง๋ค์ด๋ด.) ํ์ด์ง๋ ๋ง๋ค๊ณ ๊ฐ๋ฐ์ผ์ง๋ ์จ๋ณด๊ธฐ ์์.
๊ทผ๋ฐ ํ์ด์ค๋ถ ์ผ๋ฐ.
์์ฑ์์ฑ