Example #1
0
    void Start()
    {
        cRigid   = GetComponent <Rigidbody>();
        cCam     = GetComponentInChildren <PC_Cam>();
        cGun     = GetComponent <PC_Gun>();
        cGrnd    = GetComponent <PC_Grnd>();
        cShields = GetComponent <PC_Shields>();

        _health = _maxHealth;
    }
Example #2
0
 public void FRun()
 {
     if (Input.GetMouseButton(0))
     {
         if (_ammo > 0)
         {
             if (Time.time - _lastFireTime > _fireInterval)
             {
                 PC_Cam  c = GetComponentInChildren <PC_Cam>();
                 PJ_Plas p = Instantiate(PF_Plasmoid, rFirePoint.transform.position, transform.rotation);
                 Instantiate(PF_MuzzleFlash, rFirePoint.transform.position, transform.rotation);
                 p.FFireDirection(c.transform.forward);
                 cAudio.FFireGun();
                 _lastFireTime = Time.time;
                 _ammo--;
             }
         }
     }
 }