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(); } }
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"]; } }
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(); }
private void SetFromProperties() { CurrGun = (TypeGuns)PhotonNetwork.LocalPlayer.CustomProperties["currGun"]; UpdateActiveWeapon(); }