EsteemedTightAsianlion-size_restricted.gif

ย public void Fire()

ย  ย  {ย  ย  ย  ย ย 

ย  ย  ย  ย  float a = Random.Range(-1.0f, 1.0f);

ย  ย  ย  ย  float b = Random.Range(-1.0f, 1.0f);

ย  ย  ย  ย  GameObject temp = Instantiate(mortarshell, muzzle.position, Quaternion.identity);

ย  ย  ย  ย  mortarshellList.Add(temp);

ย  ย  ย  ย  for(int i=0;i<mortarshellList.Count;i++)

ย  ย  ย  ย  {

ย  ย  ย  ย  ย  ย mortarshell _mortarshell = mortarshellList[i].GetComponent<mortarshell>();

ย  ย  ย  ย  ย  ย  _mortarshell.start = muzzle.transform.position;

ย  ย  ย  ย  ย  ย  _mortarshell.end = mortarRange.transform.position + new Vector3(a,b,0);ย 

ย  ย  ย  ย  }ย  ย ย 

ย  ย  }


์ด๋ ‡๊ฒŒ ๋ฐ”๊ฟจ์Œ

_mortarshell.start๋ž‘ _mortarshell.end๋ฅผ transformํ˜•์‹์—์„œ vector3 ํ˜•์‹์œผ๋กœ ๋ณ€ํ™˜ํ•˜๊ณ  ์ €๋ ‡๊ฒŒ ๋งŒ๋“ค๊ธด ํ–ˆ๋Š”๋ฐ


๊ธฐ์กด์— transform ์ด์—ˆ์„๋•Œ๋Š” ์–ด๋–ป๊ฒŒ ํ–ˆ์–ด์•ผํ•จ?ย