Example #1
0
    void Shot()
    {
        //弾がある 又は リロードをしていない.
        if (bulletNum > 0 && !reloadFlg)
        {
            //新
            Quaternion bulletQuant = transform.rotation;
            bulletQuant.Set(
                bulletQuant.x + Random.Range(-bure, bure),
                bulletQuant.y,
                bulletQuant.z,
                bulletQuant.w
                );
            Instantiate(handGunBullet, transform.position, bulletQuant);

            bulletNum--;
            BulletRem(bulletNum);
            cursolScript.SendMessage("kick", new Vector2(Random.Range(kickMin.x, kickMax.x), Random.Range(kickMin.y, kickMax.y)));
        }
        if (bulletNum == 0)
        {
            Vector3 pPos = player.transform.position;
            Instantiate(reloadAlert, new Vector3(pPos.x, pPos.y, pPos.z + 1), Quaternion.Euler(0, 0, 0));
        }
    }
Example #2
0
 /// <summary>
 /// 撃った時
 /// </summary>
 void Shot()
 {
     //弾がある 又は リロードをしていない
     if (bulletNum > 0 && !reloadFlg)
     {
         Instantiate(LauncherBullet, transform.position, transform.rotation);
         Instantiate(Efe_bulletParticle, transform.position, transform.rotation);
         bulletNum--;
         BulletRem(bulletNum);
         cursolScript.SendMessage("kick", new Vector2(Random.Range(kickMin.x, kickMax.x), Random.Range(kickMin.y, kickMax.y)));
     }
     if (bulletNum == 0)
     {
         Instantiate(reloadAlert);
     }
 }
Example #3
0
 void Shot()
 {
     shotWaitTimer += Time.deltaTime;
     //弾がある 又は リロードをしていない.
     if (bulletNum > 0 && !reloadFlg && shotWaitTimer >= shotWait)
     {
         var bulletPos = transform.position;
         bulletPos.y += 0.9f;
         Instantiate(machineGunBullet, bulletPos, transform.rotation);
         bulletNum--;
         BulletRem(bulletNum);
         shotWaitTimer = 0.0f;
         cursolScript.SendMessage("kick", new Vector2(Random.Range(kickMin.x, kickMax.x), Random.Range(kickMin.y, kickMax.y)));
     }
     if (bulletNum == 0)
     {
         Instantiate(reloadAlert);
     }
 }