コード例 #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 ();
            }
        }
    }
コード例 #2
0
ファイル: game_Over.cs プロジェクト: sachinjain3677/BomberMan
 // Use this for initialization
 void Start()
 {
     bsae = GameObject.Find("GameController").GetComponent <BombSpawnAndExplode> ();
     game_over_menu.SetActive(false);
 }
コード例 #3
0
 void Start()
 {
     bsae = GameObject.Find("GameController").GetComponent <BombSpawnAndExplode>();
     pc   = GetComponent <PlayerController> ();
 }