// randrom olarak engeller olusturur void RandomSeaDamageObjectGenerator(int lvl) { GameObject barrier; if (sharkCreate.getPlayBool()) { for (int i = 0; i < 3; i++) { barrier = Instantiate(seaDamageObject[Random.Range(0, lvl)].getSeaGameObject(), new Vector3(RandomPositionXGenarator(), 0.3f, damagePositionZ), Quaternion.identity); sharkSwim.allObject.Add(barrier); damagePositionZ += 4.8f; advantageFishPositionZ = damagePositionZ - 0.5f; advantageCoinPositionZ = damagePositionZ - 0.8f; advantageBarrelPositionZ = damagePositionZ - 1f; advantageHealthPositionZ = damagePositionZ - 1.3f; } } }
// sag sol yapmasini saglar void Move() { if (Input.touchCount > 0 && sharkCreate.getPlayBool()) { Touch touch; touch = Input.GetTouch(0); if (touch.phase == TouchPhase.Moved) { transform.position = new Vector3(transform.position.x + touch.deltaPosition.x * speedModifier, transform.position.y, transform.position.z); } } }