// Start is called before the first frame update void Start() { SkorManager = FindObjectOfType <SkorManager>(); BoardController = FindObjectOfType <BoardController>(); int PositionRandom = Random.Range(-2, 2); transform.position = new Vector3(PositionRandom, 7, 0); }
// Start is called before the first frame update void Start() { Ucgen = FindObjectOfType <Ucgen>(); Besgen = FindObjectOfType <Besgen>(); BesgenScript = FindObjectOfType <BesgenScript>(); AudioSource = GetComponent <AudioSource>(); Board = FindObjectOfType <BoardController>(); SkorManager = FindObjectOfType <SkorManager>(); go = GameObject.FindWithTag("deadbox"); // Board = GetComponent<BoardController>(); }
// Start is called before the first frame update void Start() { float width = Screen.width; float height = Screen.height; Debug.Log(width); Debug.Log(height); AtesOzellik = FindObjectOfType <AtesOzellik>(); UcgenScript = FindObjectOfType <UcgenScript>(); Besgen = FindObjectOfType <Besgen>(); TopKontrol = FindObjectOfType <TopKontrol>(); BesgenScript = FindObjectOfType <BesgenScript>(); SkorManager = FindObjectOfType <SkorManager>(); ReklamScript = FindObjectOfType <ReklamScript>(); AudioSource = GetComponent <AudioSource>(); AtisSayisiText.text = "X" + atisSayisi.ToString(); baslangicPozisyonu = Camera.main.ViewportToWorldPoint(new Vector3(0, 0, 0)); bitisPozisyonu = Camera.main.ViewportToWorldPoint(new Vector3(1, 0, 0)); hareket = GetComponent <Rigidbody2D>(); }
void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Senjata")) { Destroy(other.gameObject); if (gameObject.name == "musuh-kuat" || gameObject.name == "musuh-kuat(Clone)") { anim.SetTrigger("hit"); mm.speed = 0; health--; if (health == 0) { SkorManager.tambahSkor(tambahSkor); Destroy(gameObject); } } else { SkorManager.tambahSkor(tambahSkor); Destroy(gameObject); } } }
// Start is called before the first frame update void Start() { SkorManager = FindObjectOfType <SkorManager>(); }