private void Start() { sharkCreate = FindObjectOfType <SharkCreate>(); target = sharkCreate.getSharkPlayer().transform; childTarget = sharkCreate.getSharkPlayer().transform.GetChild(0).gameObject.transform; childTarget.GetComponent <SharkSwim>().OnDamage += CameraShake; }
// surekli olarak z ekseninde ilerlemesini saglar void MoveSpeed() { sharkCreate.getSharkPlayer().transform.position = new Vector3(sharkCreate.getSharkPlayer().transform.position.x, sharkCreate.getSharkPlayer().transform.position.y, sharkCreate.getSharkPlayer().transform.position.z + speed * Time.deltaTime); movePositionZ = sharkCreate.getSharkPlayer().transform.position.z; if (PlayerPrefs.GetInt("Start") == 1) { positionScor = sharkCreate.getSharkPlayer().transform.position.z; PlayerPrefs.SetInt("Start", 0); } }
// main camera nin pozisyonunu gunceller void CameraPosition() { transform.position = new Vector3(transform.position.x, transform.position.y, sharkCreate.getSharkPlayer().transform.position.z); }