void Update() { if (game_start) { for (int i = 0; i < arrow_queue.Count; i++) { GameObject temp = arrow_queue[i]; //collot arrow when arrow count is >7, or out of broader if (temp.transform.position.z > 30 || arrow_queue.Count > 7) { arrow_factory.FreeArrow(arrow_queue[i]); arrow_queue.Remove(arrow_queue[i]); } } } }
void Update() { if (game_start) { arrow_factory.FreeArrow(); } }
void Update() { if (game_start) { Vector3 mpos = Camera.main.ScreenPointToRay(Input.mousePosition).direction; if (Input.GetButtonDown("Fire1")) { Shoot(mpos * 15); } if (arrow == null) { arrow = arrow_factory.GetArrow(); arrow.transform.position = bow.transform.position; arrow.gameObject.SetActive(true); arrow.GetComponent <Rigidbody>().isKinematic = true; } bow.transform.LookAt(mpos * 30); arrow.transform.LookAt(mpos * 30); arrow_factory.FreeArrow(); } }