// Update is called once per frame void Update() { gameControllerHolder = GameObject.Find("GameController"); if (gameControllerHolder != null) { bsae = gameControllerHolder.GetComponent <BombSpawnAndExplode> (); if (Input.mousePosition.y >= button.position.y - button.rect.height / 2 && Input.mousePosition.y <= button.position.y + button.rect.height / 2 && Input.mousePosition.x <= button.position.x + button.rect.width / 2 && Input.mousePosition.x >= button.position.x - button.rect.width / 2) { if (Input.GetMouseButtonDown(0)) { bsae.fire_button_pressed = true; //music.Play (); } } if (Input.GetMouseButtonUp(0)) { bsae.fire_button_pressed = false; //music.Stop (); } } }
// Use this for initialization void Start() { bsae = GameObject.Find("GameController").GetComponent <BombSpawnAndExplode> (); game_over_menu.SetActive(false); }
void Start() { bsae = GameObject.Find("GameController").GetComponent <BombSpawnAndExplode>(); pc = GetComponent <PlayerController> (); }