Example #1
0
 public ActivePlayer(ControlPC _pc, int _teamNo, int _refID, string _name)
 {
     playerObject = _pc;
     teamNumber   = _teamNo;
     referenceID  = _refID;
     playerName   = _name;
 }
 void Start()
 {
     pc                 = GetComponentInParent <ControlPC>();
     nextPosition.x     = pc.transform.position.x;
     nextPosition.z     = pc.transform.position.z;
     nextPosition.y     = head.position.y;
     transform.position = nextPosition;
 }
Example #3
0
    private void OnTriggerEnter(Collider other)
    {
        ControlPC pc = other.GetComponent <ControlPC>();

        if (pc)
        {
            pc.CmdEnterKillzone();
        }
    }
Example #4
0
 public void BeginRound()
 {
     pc = Instantiate(pcPrefab, Vector3.zero, Quaternion.identity);
     pc.currentLives = startingLives;
     livesText.text  = startingLives.ToString();
     wm         = Instantiate(waveManagerPrefab);
     nextLifeAt = newLifeEvery;
     wm.SpawnWave();
 }
Example #5
0
    // Use this for initialization
    void Start()
    {
        controlPC = transform.parent.gameObject.GetComponent <ControlPC>();
        //Debug.Log (controlPC.backValueX);
        Vector3 angles = transform.eulerAngles;

        x = angles.y;
        y = angles.x;
    }
Example #6
0
 private bool HasPlayerBeenHit(ControlPC _pc)
 {
     foreach (ControlPC item in playersHit)
     {
         if (item == _pc)
         {
             return(true);
         }
     }
     return(false);
 }
 //[Command]
 public void ShootPC(GameObject hitPoint, int dmg, int layer)
 {
     if (hitPoint)
     {
         ControlPC _pc = hitPoint.GetComponent <HitboxLink>().pc;
         if (_pc)
         {
             print("PC hit");
             if (layer == 10)    // if it's a headshot
             {
                 _pc.TakeDamage(weaponDamage * 2);
             }
             else    // it's a body shot
             {
                 _pc.TakeDamage(weaponDamage);
             }
         }
         else
         {
             print("No PC");
         }
     }
 }
Example #8
0
 private void Start()
 {
     pc          = GetComponentInParent <ControlPC>();
     currentAmmo = clipSize;
 }