Advertisement
kadyr

Untitled

Sep 11th, 2021
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Photon.Pun;
  5. public class NetworkMove : MonoBehaviour, IPunObservable
  6. {
  7. PhotonView _photonView;
  8. public bool finish;
  9. void Start()
  10. {
  11. _photonView = GetComponent<PhotonView>();
  12. if (!_photonView.IsMine)
  13. {
  14. GetComponent<PlayerLook>().enabled = false;
  15. GetComponent<GuyMove>().enabled = false;
  16. GetComponentInChildren<Camera>().gameObject.SetActive(false);
  17. }
  18. }
  19.  
  20. public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
  21. {
  22. if (stream.IsWriting)
  23. stream.SendNext(finish);
  24. else
  25. finish = (bool)stream.ReceiveNext();
  26. }
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement