Advertisement
kadyr

Untitled

Sep 11th, 2021
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 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. if (!_photonView.IsMine)
  12. {
  13. GetComponent<PlayerLook>().enabled = false;
  14. GetComponent<GuyMove>().enabled = false;
  15. GetComponentInChildren<Camera>().gameObject.SetActive(false);
  16. }
  17. }
  18.  
  19. public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
  20. {
  21. if (stream.IsWriting)
  22. stream.SendNext(finish);
  23. else
  24. finish = (bool)stream.ReceiveNext();
  25. }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement