Esempio n. 1
0
    //void Update()
    //{
    //	// check that we're not selecting
    //	if (playerCollectableController.IsSelecting()) // || playerTeleportController.IsSelecting())
    //	{
    //		return;
    //	}

    //	// check for button press (mobile only)
    //	if (Input.GetButtonDown("Fire1"))
    //	{
    //		OnShootButton();
    //	}
    //}

    public void OnShootButton()
    {
        if (gunController != null)
        {
            if (gunController.CanShoot() && !playerCollectableController.IsSelecting())
            {
                gunController.Shoot();
            }
        }
    }
    void Update()
    {
        // check that we are not selecting (items, teleportation)
        if (playerCollect.IsSelecting() || playerTeleport.IsSelecting())
        {
            return;
        }

        // check for button press
        if (Input.GetButtonDown("Fire1"))
        {
            if (gun.CanShoot())
            {
                gun.Shoot();
            }
        }
    }
Esempio n. 3
0
 void Update()
 {
     //not selecting
     if (playerCollect.IsSelecting() || playerTele.IsSelecting())
     {
         return;
     }
     //check for button press
     if (Input.GetButtonDown("Fire1"))
     {
         if (gun.CanShoot())
         {
             gun.Shoot();
         }
     }
     if (Input.GetButtonDown("Fire3"))
     {
         CreateSpawn();
     }
     if (Input.GetButtonDown("Jump"))
     {
         CreateTurret();
     }
 }