viewimage.php?id=2abcdd23dad63db0&no=24b0d769e1d32ca73cec8efa11d02831ed3c848cabfee483347b0fb096a803c552e0edc896df9f8274b09b7d8bc895a18c3c449d70466a6e315419d164913e53e596d5


public class Arrowtrap : MonoBehaviour

{

ย  ย  public GameObject Arrow;

ย  ย  public Transform Arrowpos;

ย  ย  public float arrowdelay;

ย  ย  private float arrowcooltime;

ย  ย  public bool Active = true;


ย  ย  // Start is called before the first frame update

ย  ย  void Start()

ย  ย  {

ย  ย  ย  ย  if (Active = true)

ย  ย  ย  ย  {

ย  ย  ย  ย  ย  ย  StartCoroutine("Spawnarrow");

ย  ย  ย  ย  ย  ย  Debug.Log("spawn start");

ย  ย  ย  ย  }

ย  ย  }


ย  ย  // Update is called once per frame

ย  ย  void Update()

ย  ย  {


ย  ย  }

ย  ย  IEnumerable Spawnarrow()

ย  ย  {

ย  ย  ย  ย  while (true)

ย  ย  ย  ย  {

ย  ย  ย  ย  ย  ย  Debug.Log("spawn repeat");

ย  ย  ย  ย  ย  ย  Instantiate(Arrow, Arrowpos);

ย  ย  ย  ย  ย  ย  yield return new WaitForSeconds(1);

ย  ย  ย  ย  }


ย  ย  }

}


1์ดˆ๋งˆ๋‹ค ํ™”์‚ด์„ ์ƒ์„ฑํ•˜๋Š” ์ฝ”๋“œ๋ฅผ ์“ฐ๊ณ  ์‹ถ์€๋ฐ

์ฝ”๋ฃจํ‹ด ๋ถ€๋ถ„์ด ์•ˆ ๋Œ์•„๊ฐ„๋‹ค ๋กœ๊ทธ๋„ ์•ˆ ๋‚˜์˜ค๊ณ 

๋ญ๊ฐ€ ๋ฌธ์ œ์ž„?