Exemple #1
0
    private ShootFunction[] Shoot = new ShootFunction[3]; // 3 is a count of guns

    public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
    {
        if (stream.IsWriting)
        {
            stream.SendNext((int)CurrGun);
        }
        else
        {
            CurrGun = (TypeGuns)(int)stream.ReceiveNext();
        }
    }
Exemple #2
0
 public void UpdateCurrWeapon()
 {
     if (playerController.photonView.IsMine)
     {
         CurrGun     = (TypeGuns)PhotonNetwork.LocalPlayer.CustomProperties["currGun"];
         CurrGunData = Guns[(int)CurrGun]?.GetComponent <Gun>();
         canShoot    = true;
         EventManager.UpdateUIEvent.Invoke();
     }
     else
     {
         CurrGun = (TypeGuns)PhotonNetwork.PlayerListOthers[0].CustomProperties["currGun"];
     }
 }
Exemple #3
0
    private IEnumerator DeclareOriginal()
    {
        DisableGuns();

        yield return(new WaitForSeconds(.5f));

        Shoot[(int)TypeGuns.Pistol]   = ShootPistol;
        Shoot[(int)TypeGuns.Bow]      = ShootBow;
        Shoot[(int)TypeGuns.Launcher] = ShootLauncher;

        CurrGun = GetWeapon();

        EventManager.UsedGunsChangeEvent.Invoke();
    }
Exemple #4
0
 private void SetFromProperties()
 {
     CurrGun = (TypeGuns)PhotonNetwork.LocalPlayer.CustomProperties["currGun"];
     UpdateActiveWeapon();
 }