Esempio n. 1
0
    // 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 ();
            }
        }
    }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     bsae = GameObject.Find("GameController").GetComponent <BombSpawnAndExplode> ();
     game_over_menu.SetActive(false);
 }
Esempio n. 3
0
 void Start()
 {
     bsae = GameObject.Find("GameController").GetComponent <BombSpawnAndExplode>();
     pc   = GetComponent <PlayerController> ();
 }