Exemplo n.º 1
0
 void Update()
 {
     if (LeeController.leeActive)
     {
         if (pistolActive) //The pistol is the current weapon in use
         {
             if (firing)
             {
                 if (Input.GetMouseButtonDown(0)) //Fires a bullet when the player left-clicks.
                 {
                     PistolBulletController bulletInstance = Instantiate(pistolBullet, spawnPoint.position, spawnPoint.rotation) as PistolBulletController;
                     bulletInstance.speed = bulletSpeed;
                     StartCoroutine(Fire());
                     pistolShot.Play();
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 void Awake()
 {
     _controller = GetComponent <PistolBulletController>();
 }