interface State extends Schema {
players: MapSchema<Player>;
}
class Player extends Schema {
sessionId: string;
zepetoHash: string;
zepetoUserId: string;
transform: Transform;
state: number;
typesOfgames: string;
}
class Transform extends Schema {
position: Vector3;
rotation: Vector3;
}
class Vector3 extends Schema {
x: number;
y: number;
z: number;
}
유저가 오브젝트와 충돌 하였을때 OnTriggerEnter를 호출 하고 서버로 메시지를 보냅니다.
서버는 닿은 유저를 찾아내고 스키마 데이터를 수정합니다.
수정한 데이터를 받은 클라이언트에서 ShowUI메소드를 호출하여 UI를 출력하는데
클라이언트에서 모든 클라이언트에게 충돌 되었다는 메시지와 UI가 동시 출력 되는 현상입니다.
유니티 하이어라키에는 출력될 Canvas UI와 충돌을 감지하는 Collider가 배치 되어 있는 상황입니다.
여기서 어떻게 충돌 된 유저만 서버에 있는 스키마 데이터를 수정하고
해당 유저에게만 UI를 표시 할 수 있는지 답변 주시면 감사하겠습니다.
***추가적으로 Teleport 메소드 사용시 유저간 동기화가 안되는 현상이 있는데, 의도 된것인지
의도 된것이라면 유저를 어떻게 동기 상태로 Teleport시킬 수 있는지 궁금합니다.
안녕하세요, 현재 특정 오브젝트와 충돌 시 다중 클라이언트에게 같은 메시지가 가는 현상이 발생 하였는데 해결 방법을 모르겠습니다.
아래는 클라이언트 코드 예시 입니다.
아래는 서버 코드 예시입니다.
아래는 스키마 코드 예시입니다.
유저가 오브젝트와 충돌 하였을때 OnTriggerEnter를 호출 하고 서버로 메시지를 보냅니다. 서버는 닿은 유저를 찾아내고 스키마 데이터를 수정합니다. 수정한 데이터를 받은 클라이언트에서 ShowUI메소드를 호출하여 UI를 출력하는데 클라이언트에서 모든 클라이언트에게 충돌 되었다는 메시지와 UI가 동시 출력 되는 현상입니다.
유니티 하이어라키에는 출력될 Canvas UI와 충돌을 감지하는 Collider가 배치 되어 있는 상황입니다.
여기서 어떻게 충돌 된 유저만 서버에 있는 스키마 데이터를 수정하고 해당 유저에게만 UI를 표시 할 수 있는지 답변 주시면 감사하겠습니다.
***추가적으로 Teleport 메소드 사용시 유저간 동기화가 안되는 현상이 있는데, 의도 된것인지 의도 된것이라면 유저를 어떻게 동기 상태로 Teleport시킬 수 있는지 궁금합니다.
감사합니다.