if (Input.GetKey(KeyCode.Space))
{
PhotonNetwork.Instantiate("Bullet", transform.position + new Vector3(SR.flipX ? -0.4f : 0.4f, -0.11f, 0), Quaternion.identity)
.GetComponent<PhotonView>().RPC("DirRPC", RpcTarget.All, SR.flipX ? -1 : 1);
AN.SetTrigger("shot");
}
๋น์ฐํ ๊ฒ์๋ฉ์ด์ปค๋ก ๋์ถฉ๋์ถฉ ๋ง๋ ๊ฒ๋ง๋ฅ Bullet์ด ๋ ์ด์ ๋ง๋ฅ ์๋ฒฝํ ์ผ์ง์ ์ผ๋ก ๋๊ฐ.
GetKey๊ฐ์ด ํ๋๋ง ํด๋ Bullet์ด ๋๊ฐ๋ ๋์ ์ 0.2~0.3์ด์ ๋๋ ์ด๋ฅผ ๊ฐ์ง๊ณ ๋๊ฐ๊ฒ ํ ์๋ ์์?
float๋ณ์ ํ๋ ๋๊ณ GetKey๊ฐ true์ธ ๋์ ๋ธํํ์๋งํผ ์ฆ๊ฐํ๊ฒํ์
์ฝ๋ฃจํด ์จ์ GetKeyDown ํ ๋ StartCoroutineํ๊ณ GetKeyUpํ ๋ StopCoroutineํด์ ํด๋ณด์
์ธ๋ณดํฌ๋ฆฌํผํ ํจ์ ์กฐ๊ฑด์ ์ดํ๋ฌธ ๋ฃ๋ ๋ฐฉ๋ฒ๋ ์์ด์