예제 #1
0
파일: Equipment.cs 프로젝트: nasa03/RSG
 void Update()
 {
     if (currentequipment != null)
     {
         if (Input.GetButtonUp("Use EQP")) //if player uses EQP
         {
             if (currentitemscript.UseItem())
             {
                 GameObject placeditem = Instantiate(currentequipment, transform.position - new Vector3(0, 0.18f, 0), Quaternion.identity);
             }
             else
             {
                 Debug.Log("Ran Out of Equip");
             }
         }
     }
 }
예제 #2
0
파일: MCMovement.cs 프로젝트: nasa03/RSG
 private void Shoot()
 {
     if (endofAiming && shooting)
     {
         if (thegun.UseItem())
         {
             shotsfired++;
             audioSource.PlayOneShot(gunsound, 1f);
             GameObject bullet = Instantiate(bulletprefab, bulletpos, Quaternion.identity);
             bullet.GetComponent <BulletScript>().velocity = aim * bulletSpeed;
             Destroy(bullet, 1f);
         }
         else
         {
             audioSource.PlayOneShot(emptygun, 1f);
         }
     }
 }