void Update() { if (GameCore.instance.gameType == 0) { timer += Time.deltaTime; if (timer >= ChooseTime(maxTime, minTime) && youcanCreate == true) { youcanCreate = false; CreateRandomPoint(); timer = 0; youcanChoose = true; } else if (PointOlusturuldu == true && RocketPoint != null) { youcanChoose = true; Vector2 pos = RocketPoint.transform.position; pos.y = Mathf.Lerp(pos.y, GameObject.FindGameObjectWithTag("Player").transform.position.y, 5f * Time.deltaTime); if (timer >= ChooseTime(5, 10) && RocketPoint != null) { StartCoroutine(CreateRocket()); } pos = MainCamera.GetComponent <Camera>().WorldToViewportPoint(pos); pos.x = 0.98f; pos = MainCamera.GetComponent <Camera>().ViewportToWorldPoint(pos); RocketPoint.transform.position = pos; } } else { timer = 0; if (Rocket != null && Rocket.activeSelf == true) { poolRocket.HavuzaObjeEkle(Rocket); // Destroy(Rocket); } else if (RocketPoint != null && RocketPoint.activeSelf == true) { poolRocketPoint.HavuzaObjeEkle(RocketPoint); // Destroy(RocketPoint); } } }