-
포톤을 활용한 네트워크 게임 개발유니티 2022. 10. 5. 01:10
이전 씬에서 저장된 캐릭터 닉네임을 PlayerPrefs로 넘겨준 뒤,
플레이 화면에서 플레이어 위에 뛰우고 싶었는데
새로운 창에서 기존 플레이어의 오브젝트 닉네임을 제대로 전달하지 않는 오류를 발견했다..
기존에 존재하는 플레이어의 RPC 함수가 제대로 호출이 안되는 것 같아서
이것저것 뒤져보다가..
RpcTarget.All 에서 RpcTarget.AllBuffered로 수정해주니까 모든 창에서
플레이어 닉네임이 제대로 나온다..
RpcTarget.AllBuffered는 씬에 있는 모든 클라이언트에게 적용(클라이언트가 떠나기 전까지),
RpcTarget.All은 나중에 참여하는 클라이언트에게는 적용시키지 않는다고 한다.
그렇다면 나중에 들어온 2222 캐릭터의 닉네임이 안 나와야 하는 거 아닌가...?아래는 RpcTarget에 대한 내용..
https://doc-api.photonengine.com/en/pun/v2/group__public_api.html#ga7c6a0c7a9a36c014e9c416ffaeef8b9b
Photon Unity Networking 2: Public API
Groups the most important classes that you need to understand early on. More... enum ClientState State values for a client, which handles switching Photon server types, some operations, etc. More... enum PunLogLevel Used to define the level of l
doc-api.photonengine.com
'유니티' 카테고리의 다른 글
아고라 영상 및 채팅 시스템 (0) 2022.12.08 List 자료형, 참조자 선언 등. (1) 2022.10.07 c# lock 키워드 (0) 2022.10.04 c# delegate(델리게이트) (0) 2022.10.04 포톤 네트워크 이용하기 (0) 2022.10.03