Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

내가 상호작용할 오브젝트 하나만 아웃라인 표시되기 #8

Open
wants to merge 832 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
832 commits
Select commit Hold shift + click to select a range
ee63316
locate배터리 스포너 완성
youjin-43 May 18, 2024
1a94cba
Merge branch 'develop' into fix/SpawnerAddcomponent
Noewewwwew May 18, 2024
992054d
마스터만 맵 구성에 관여할 수 있도록
youjin-43 May 18, 2024
dd2f933
all -> allbufferd
youjin-43 May 18, 2024
aa239b5
게임 시작시 방 닫기
dydwo0809 May 18, 2024
71a5d66
로봇 오브젝트 삭제
shware10 May 18, 2024
d6d17c6
Merge pull request #257 from kookmin-sw/MonsterSpawn
dydwo0809 May 18, 2024
68f3a85
Merge branch 'develop' into fix/SpawnerAddcomponent
youjin-43 May 18, 2024
ecdc3e5
Merge branch 'develop' into feature/GameStart
dydwo0809 May 18, 2024
b2442e1
공격중 오브젝트랑 콜라이더 안받아오는 현상 해결
Noewewwwew May 18, 2024
4b29eea
잘 되는지 확인
youjin-43 May 18, 2024
85e23ef
몬스터 스폰포인트 추가
shware10 May 18, 2024
0fdd3f6
Merge branch 'develop' into feature/MonsterSpawn
shware10 May 18, 2024
a1b05b9
Merge pull request #258 from kookmin-sw/MonsterSpawn
dydwo0809 May 18, 2024
f1a6994
중간저장
youjin-43 May 18, 2024
9ed46ce
Merge branch 'develop' into fix/SpawnerAddcomponent
youjin-43 May 18, 2024
f68bdd8
스포너의 working 변수를 통해 스포너 관리
youjin-43 May 18, 2024
5af9569
포톤뷰
youjin-43 May 18, 2024
8554e7b
인원 제한 2명으로 수정
dydwo0809 May 18, 2024
acff0c6
Merge pull request #259 from kookmin-sw/fix/SpawnerAddcomponent
dydwo0809 May 18, 2024
98ea51f
Merge branch 'develop' into feature/GameStart
dydwo0809 May 18, 2024
d6e35db
룸 생성 실험
dydwo0809 May 18, 2024
97d174e
방 닫는 기능 구현
dydwo0809 May 18, 2024
5cba685
Merge pull request #260 from kookmin-sw/feature/GameStart
dydwo0809 May 18, 2024
bac2f3d
웨폰(아이템)스포너 설치
youjin-43 May 18, 2024
d256504
Merge pull request #261 from kookmin-sw/fix/weaponSpawner
dydwo0809 May 18, 2024
cf9ac06
탈출구에도 암막 추가
dydwo0809 May 19, 2024
0716547
Merge pull request #262 from kookmin-sw/bugfix/exit
dydwo0809 May 19, 2024
921b40d
몬스터 스폰 및 플레이어 탐색 후 이동 기능 구현
shware10 May 19, 2024
85ead2b
Merge pull request #263 from kookmin-sw/MonsterSpawn
dydwo0809 May 19, 2024
f7bfa49
Merge branch 'develop' into feature/공격-중-스왑-불가
Noewewwwew May 19, 2024
8263953
공격중일 때 공격 불가능하게 막음
Noewewwwew May 19, 2024
0974bb2
Merge pull request #264 from kookmin-sw/feature/공격-중-스왑-불가
dydwo0809 May 19, 2024
22a3b1f
탈출 함수 뼈대 구현
dydwo0809 May 19, 2024
eb3bbc0
Merge branch 'develop' into feature/escapeTrigger
dydwo0809 May 19, 2024
efda24e
Merge pull request #265 from kookmin-sw/feature/escapeTrigger
dydwo0809 May 19, 2024
4725b5c
불필요한 debugLog 제거
Noewewwwew May 19, 2024
15da491
스포너 추가 배치 및 맵 일부 수정
youjin-43 May 19, 2024
449630b
Merge pull request #266 from kookmin-sw/DebugLog/debugLog제거
dydwo0809 May 19, 2024
0b77086
Merge pull request #267 from kookmin-sw/feature/LocateAdditionalSpawners
dydwo0809 May 19, 2024
100d458
호출 직전까지
bryanjang May 19, 2024
2652f7b
Revert "호출 직전까지"
bryanjang May 19, 2024
516ef8d
Merge branch 'develop' into feature/sound2222
bryanjang May 19, 2024
4110ef8
호출 전까지
bryanjang May 19, 2024
a89de62
Update AudioManager.cs
bryanjang May 19, 2024
d61361c
상태 갇히는 버그 해결
Noewewwwew May 19, 2024
fe7fcf4
Merge pull request #268 from kookmin-sw/bugfix/상태-갇히는-버그
dydwo0809 May 19, 2024
98af7ce
탈출구 충돌 처리 중간 저장
dydwo0809 May 19, 2024
e710e8a
Merge branch 'develop' into feature/escapeTrigger
dydwo0809 May 19, 2024
3c2ab0e
디버그 추가
dydwo0809 May 19, 2024
147db02
escape에 포톤뷰 추가
dydwo0809 May 19, 2024
1c1e4ae
Merge pull request #269 from kookmin-sw/feature/escapeTrigger
dydwo0809 May 19, 2024
6c6b04a
임시저장
youjin-43 May 19, 2024
453bb50
빌드용 커밋
dydwo0809 May 19, 2024
e450bf9
Merge pull request #270 from kookmin-sw/bugfix/addNamespace
dydwo0809 May 19, 2024
5f5fa8a
몬스터 수정 및 게임오버 조건 추가
shware10 May 19, 2024
c5ffd32
탈출 시 게임 오버 기능 구현
shware10 May 20, 2024
dee98f6
탈출 시 이벤트 구현
shware10 May 20, 2024
6a56a32
ui매니저 수정
shware10 May 20, 2024
3a03ad5
Merge pull request #271 from kookmin-sw/MonsterSpawn
dydwo0809 May 20, 2024
0fc7110
탈출 시스템 수정
shware10 May 20, 2024
d984f8c
탈출 시 이벤트 수정
shware10 May 20, 2024
8ee7574
Update HpManager.cs
shware10 May 20, 2024
db0349d
수정2차
shware10 May 20, 2024
b9aac41
수정 3차
shware10 May 20, 2024
7dc08b4
수정4차
shware10 May 20, 2024
5fa0752
수정 5차
shware10 May 20, 2024
f53b59e
수정 5차
shware10 May 20, 2024
5da970d
수정 6차
shware10 May 20, 2024
d0befc2
게임 시작 로직 변경
dydwo0809 May 20, 2024
dd37047
rpc 잘못 호출하고 있는거 수정
dydwo0809 May 20, 2024
c095d30
함수 순서 변경 실험
dydwo0809 May 20, 2024
1c7ef3a
주석 추가 및 약간의 변경
dydwo0809 May 20, 2024
72bed03
디버그 추가
dydwo0809 May 20, 2024
5325872
순서 변경 실험
dydwo0809 May 20, 2024
3eb4af0
All Die 함수 수정
dydwo0809 May 20, 2024
b2b4ef1
Merge pull request #272 from kookmin-sw/feature/EscapeGameOver
dydwo0809 May 20, 2024
77b73be
Merge pull request #273 from kookmin-sw/develop
dydwo0809 May 20, 2024
da6eb82
스태미너를 소진해도 계속 달리는 버그 해결
Noewewwwew May 21, 2024
a91e4e0
Merge pull request #274 from kookmin-sw/bugfix/스태미너를-소진해도-달리는-버그
dydwo0809 May 21, 2024
f4eb3af
씬 로드 로직 수정
dydwo0809 May 21, 2024
81bc307
temp
bryanjang May 21, 2024
5da7f55
Merge pull request #275 from kookmin-sw/bugfix/lobby
dydwo0809 May 21, 2024
38a02db
Merge branch 'develop' into feature/LocateAdditionalSpawners
youjin-43 May 21, 2024
3208c88
Merge branch 'master' into feature/sound2222
bryanjang May 22, 2024
ac00cb4
jump sound test
bryanjang May 22, 2024
5012c1e
Merge branch 'develop' into feature/sound2222
bryanjang May 22, 2024
3d1521a
sfx added2
bryanjang May 22, 2024
5fd20f0
hiddenItem 추가 및 기타 버그 수정
youjin-43 May 22, 2024
8545976
스포너들 더 추가
youjin-43 May 22, 2024
b9fc435
네트워크 수정
youjin-43 May 22, 2024
ee002d6
모두가 죽는 버그 해결
Noewewwwew May 22, 2024
5ce6ea7
게임오버 갱신 추가
shware10 May 22, 2024
8663847
hp 매니저 수정
shware10 May 22, 2024
1a449b1
수정중
youjin-43 May 22, 2024
cdbcaa9
hp매니저 수정
shware10 May 22, 2024
98c48f1
수정 2차
shware10 May 22, 2024
dd0e5f1
수정 3차
shware10 May 22, 2024
957616c
수정 4차
shware10 May 22, 2024
2bbe570
SFX update 111
bryanjang May 22, 2024
979bbed
수정중
youjin-43 May 22, 2024
9ca18c5
hit sfx update
bryanjang May 22, 2024
b18a37f
디버그 추가
youjin-43 May 22, 2024
55e7759
Merge pull request #276 from kookmin-sw/bugfix/너가죽으면나도죽어
dydwo0809 May 22, 2024
fcd2034
Merge pull request #277 from kookmin-sw/feature/LocateAdditionalSpawners
dydwo0809 May 22, 2024
d766452
사운드 RPC달았어용
Noewewwwew May 22, 2024
e2b97d3
Revert "Feature/locate additional spawners"
dydwo0809 May 22, 2024
0dc581f
Merge pull request #278 from kookmin-sw/revert-277-feature/LocateAddi…
dydwo0809 May 22, 2024
3158ebd
ismine
Noewewwwew May 22, 2024
b7e9400
인게임씬 디벨롭에 적용해야함!!!!
youjin-43 May 22, 2024
90adc9b
Merge branch 'develop' into feature/LocateAdditionalSpawners
youjin-43 May 22, 2024
2cf9a44
조합 아이템 이펙트 적용
shware10 May 22, 2024
e6a4e2e
Merge pull request #279 from kookmin-sw/feature/LocateAdditionalSpawners
dydwo0809 May 22, 2024
931558c
파라미터 변경
Noewewwwew May 22, 2024
aab35df
1차수정
Noewewwwew May 22, 2024
709b894
2차수정
Noewewwwew May 22, 2024
437dc5d
3차수정
Noewewwwew May 22, 2024
09bf644
상대방에게 파라미터를 보내지 않는 버그 해결
Noewewwwew May 22, 2024
e607c35
스폰 시점 동기화 실험
youjin-43 May 22, 2024
8e3001d
스폰 함수 위치 변경해봄
youjin-43 May 22, 2024
2a32075
조합무기 풀리퀘
shware10 May 22, 2024
f84abfc
Merge branch 'develop' into feature/CheckMapItemNetwork
youjin-43 May 22, 2024
954977b
코드 정리중
youjin-43 May 22, 2024
7f9f6bd
Merge pull request #280 from kookmin-sw/feature/CheckMapItemNetwork
youjin-43 May 22, 2024
28903ce
코드 정리 완료 및 로비에서는 템 안나오게
youjin-43 May 22, 2024
47ae114
인게임씬 변경
youjin-43 May 22, 2024
df9e221
추가 수정
youjin-43 May 22, 2024
cbf37ba
Merge pull request #281 from kookmin-sw/feature/CheckMapItemNetwork
youjin-43 May 22, 2024
ed879c3
Merge branch 'develop' into CraftEffect
shware10 May 23, 2024
fd80e4f
Merge pull request #282 from kookmin-sw/CraftEffect
dydwo0809 May 23, 2024
e5c4803
무기 이펙트 네트워크
shware10 May 23, 2024
abdbfd7
Merge pull request #283 from kookmin-sw/CraftEffect
dydwo0809 May 23, 2024
18fc98a
무기 버리는 로직 수정
dydwo0809 May 23, 2024
c480f6c
아이템 버리기 네트워크 구현
dydwo0809 May 23, 2024
c777cba
아이템 버리기에 pv.isMine 추가
dydwo0809 May 23, 2024
83cfc6d
아이템 이름에 띄어쓰기 추가
dydwo0809 May 23, 2024
1e6c1b9
도끼 이름 수정
shware10 May 23, 2024
66544c8
Merge pull request #284 from kookmin-sw/bugfix/abandonNetwork
dydwo0809 May 23, 2024
f0b9f80
데스캠 버튼 삭제/몬스터 스폰 위치 수정
shware10 May 23, 2024
08a058f
Merge pull request #285 from kookmin-sw/CraftEffect
dydwo0809 May 23, 2024
75089a2
Merge branch 'develop' into bugfix/공격-파라미터를-상대방한테-보내지-않는-버그
Noewewwwew May 23, 2024
40e097b
기존 어택파라미터 제거
Noewewwwew May 23, 2024
19642cb
Merge pull request #286 from kookmin-sw/bugfix/공격-파라미터를-상대방한테-보내지-않는-버그
dydwo0809 May 23, 2024
483c2ef
배터리 및 진통제에 pv 추가
dydwo0809 May 23, 2024
54052ba
자동으로 생기는거 커밋
dydwo0809 May 23, 2024
07fa639
Merge pull request #287 from kookmin-sw/bugfix/abandonNetwork
dydwo0809 May 23, 2024
26798ab
1차 수정
Noewewwwew May 23, 2024
a3ac1b4
2차수정
Noewewwwew May 23, 2024
717e6c4
3차수정
Noewewwwew May 23, 2024
a27e2db
4차수정
Noewewwwew May 23, 2024
3bc8543
맵 매니저 painkiller 스폰안되는 버그 수정 외 기타
youjin-43 May 23, 2024
752d39e
Merge pull request #288 from kookmin-sw/bugfix/때린만큼-반응해줘
dydwo0809 May 23, 2024
ad5aa6e
Merge branch 'develop' into fix/MapDoor
youjin-43 May 23, 2024
9d645da
Merge pull request #290 from kookmin-sw/fix/MapDoor
dydwo0809 May 23, 2024
c0d8764
최대 인원 2인 -> 4인 변경
dydwo0809 May 23, 2024
5f001ab
Merge pull request #291 from kookmin-sw/fix/ChangeNumOfPeople
dydwo0809 May 23, 2024
4b4f2c0
조합 무기 데미지 증가 적용
shware10 May 23, 2024
98ebef2
Merge pull request #292 from kookmin-sw/feature/craftWeaponDamage
dydwo0809 May 23, 2024
7120092
Merge branch 'develop' into feature/sound2222
Noewewwwew May 23, 2024
526d75b
무기 버릴 때 스폰 위치 변경
shware10 May 23, 2024
85b0265
무기데미지 수정
shware10 May 23, 2024
114740f
Merge pull request #293 from kookmin-sw/feature/craftWeaponDamage
dydwo0809 May 23, 2024
25c4b15
itemdata 포톤 없을때만 넣도록 수정
youjin-43 May 23, 2024
1b00c32
Merge pull request #294 from kookmin-sw/hotfix
youjin-43 May 23, 2024
50b05b6
다른 상태로 넘어갈 때 소리 없애는 기능 추가
Noewewwwew May 23, 2024
c6a8b11
Merge branch 'develop' into feature/sound2222
Noewewwwew May 23, 2024
e29424d
Merge pull request #296 from kookmin-sw/feature/sound2222
dydwo0809 May 23, 2024
443aeea
아이템 스폰 로직 수정
dydwo0809 May 23, 2024
0332a8c
Merge pull request #297 from kookmin-sw/bugfix/spawn
dydwo0809 May 23, 2024
f467366
몬스터 버그 픽스 완료
shware10 May 23, 2024
761a2e1
Merge pull request #298 from kookmin-sw/bugfix/MonsterBug
dydwo0809 May 23, 2024
28dfeaf
처음 생성되는 로직 변경
dydwo0809 May 23, 2024
d3ada3d
Merge pull request #299 from kookmin-sw/bugfix/allocatePV
dydwo0809 May 23, 2024
2613020
사망 시 아이템 드롭 기능
shware10 May 23, 2024
f8fab93
카운트 다운 UI 추가
shware10 May 23, 2024
09dd560
카운트 다운 RPC 추가
shware10 May 23, 2024
28e419f
수정 1차
shware10 May 23, 2024
a93628c
수정 2차
shware10 May 23, 2024
1df786f
수정 3차
shware10 May 23, 2024
ff5ca24
몬스터 스폰 숫자 수정/몬스터 떠나니는 버그 수정
shware10 May 23, 2024
baf9627
수정 5차
shware10 May 23, 2024
cf29f0e
아이템 뿜기
shware10 May 23, 2024
dbcf9eb
최대 인원수 4명으로 변경
dydwo0809 May 23, 2024
e21ae6f
Merge pull request #300 from kookmin-sw/bugfix/allocatePV
dydwo0809 May 23, 2024
841b311
수정 6차
shware10 May 23, 2024
57bf889
Merge branch 'develop' into feature/CountDown
shware10 May 23, 2024
2170683
Merge pull request #301 from kookmin-sw/feature/CountDown
dydwo0809 May 23, 2024
3ddb7b8
사용하지 않는 함수 삭제
dydwo0809 May 23, 2024
b5a7f13
Merge pull request #302 from kookmin-sw/bugfix/allocatePV
dydwo0809 May 23, 2024
4adf92b
탈출시 스왑 발동
shware10 May 23, 2024
f37215d
index.md 수정
bryanjang May 24, 2024
33500eb
Update index.md
bryanjang May 24, 2024
1812aae
Revert "Update index.md"
bryanjang May 24, 2024
429a0e9
index.md 수정 2
bryanjang May 24, 2024
e26dfca
index.md update
bryanjang May 24, 2024
f6838da
Update README.md
bryanjang May 24, 2024
b9fd87c
Update README.md
bryanjang May 24, 2024
c9bbbcd
Merge pull request #303 from kookmin-sw/feature/pages
bryanjang May 24, 2024
0f4a1fc
사망시 아이템 버리기 기능 구현
shware10 May 28, 2024
f73e9ec
필요 없는 부분 삭제
dydwo0809 May 28, 2024
ba4038b
슬롯오브젝트 할당
shware10 May 28, 2024
7086b80
디버그 로그 추가
shware10 May 28, 2024
57fe359
사망시 아이템 드롭 위치 수정
shware10 May 28, 2024
6853735
로비 라이트 설정
shware10 May 28, 2024
c436000
Merge pull request #304 from kookmin-sw/fix/lobbyScene
dydwo0809 May 28, 2024
f3e8ef0
Merge branch 'develop' into feature/DieItemsDrop
shware10 May 28, 2024
a1c6d7a
Merge pull request #305 from kookmin-sw/feature/DieItemsDrop
dydwo0809 May 28, 2024
a95b07e
스폰 위치 변경
dydwo0809 May 30, 2024
5cc8477
몬스터테스트 씬 삭제/ 몬스터 콜라이더 위치 변경/ 몬스터 스폰 시간 3분으로 변경
shware10 May 30, 2024
554e596
Merge pull request #306 from kookmin-sw/fix/spawnPoint
dydwo0809 May 30, 2024
accd621
Revert "스폰 위치 변경"
dydwo0809 May 30, 2024
4d443a1
Merge pull request #308 from kookmin-sw/revert-306-fix/spawnPoint
dydwo0809 May 30, 2024
e10b21f
Merge branch 'develop' into MonsterSpawnTime
shware10 May 30, 2024
08aa4f5
Merge pull request #309 from kookmin-sw/MonsterSpawnTime
dydwo0809 May 30, 2024
6efb047
배터리 스포너 방 안에 하나만 있도록 수정
youjin-43 May 30, 2024
ce1748e
Merge pull request #310 from kookmin-sw/fix/removeBatterySpawner
dydwo0809 May 30, 2024
0769d1d
무기 데미지 밸런스 조절
Noewewwwew May 30, 2024
0044d95
Merge pull request #311 from kookmin-sw/feature/Weapon-Damage-Balance
dydwo0809 May 30, 2024
d229554
탈출구 배터리 넣을 때 사이 간격 추가
dydwo0809 May 30, 2024
a893b40
Merge branch 'develop' into feature/betExitTime
dydwo0809 May 30, 2024
033b4a0
키보드 헬퍼
shware10 May 30, 2024
16ef0b0
키보드 헬퍼
shware10 May 30, 2024
37c5943
Merge pull request #312 from kookmin-sw/MonsterSpawnTime
dydwo0809 May 30, 2024
aedecab
Merge branch 'develop' into feature/betExitTime
dydwo0809 May 30, 2024
f79ecf8
배터리 사용 불가 ui 추가
shware10 May 30, 2024
0288e16
바닥 컨백스 체크
shware10 May 30, 2024
53f5371
자잘한 수정
dydwo0809 May 30, 2024
f4d3aa1
Merge pull request #313 from kookmin-sw/feature/betExitTime
dydwo0809 May 30, 2024
4919dd5
컨벡스 제거
shware10 May 30, 2024
83aade2
타이머 스타트
shware10 May 30, 2024
68a2b36
Merge pull request #314 from kookmin-sw/rigidConvex
dydwo0809 May 30, 2024
3b05f7e
처음에 아이템 스폰하는 로직 수정
dydwo0809 May 30, 2024
facc8e6
Merge branch 'develop' into bugfix/itemSpawn
dydwo0809 May 30, 2024
2249cbe
Merge pull request #315 from kookmin-sw/bugfix/itemSpawn
dydwo0809 May 30, 2024
2275320
hotfix
youjin-43 May 30, 2024
f7f8461
탈출 간격 로직 수정
dydwo0809 May 30, 2024
4456c01
배터리 알람
shware10 May 30, 2024
e61c39f
배터리 안들고 있을떄 예외처리
dydwo0809 May 30, 2024
a3ae89f
스포너 수정
youjin-43 May 30, 2024
ef22018
난이도 조절
youjin-43 May 30, 2024
73c9727
fix
youjin-43 May 30, 2024
5328e4d
사망시 아이템 드롭
shware10 May 30, 2024
aeec136
Merge branch 'develop' of https://github.com/kookmin-sw/capstone-2024…
shware10 May 30, 2024
6da8997
Revert "Merge branch 'develop' of https://github.com/kookmin-sw/capst…
dydwo0809 May 30, 2024
5d9b65f
fix
youjin-43 May 30, 2024
93c9265
스포너
youjin-43 May 30, 2024
db6a4e8
캔버스
shware10 May 30, 2024
a2e6afa
디버그 조건 변경
dydwo0809 May 30, 2024
bb71268
시간 갱신 pv로 변경
dydwo0809 May 30, 2024
6feeb18
자동 생성
dydwo0809 May 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
룸 생성 실험
dydwo0809 committed May 18, 2024
commit d6e35db3db0caf478d434e0f73747b6a27586804
214 changes: 107 additions & 107 deletions Assets/Scripts/Network/PhotonManager.cs
Original file line number Diff line number Diff line change
@@ -1,114 +1,114 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
using Photon.Realtime;

public class PhotonManager : MonoBehaviourPunCallbacks
{
// 버전
private readonly string version = "1.0f";

void Awake()
{
Debug.Log("userID: " + GameManager.Instance.UserId);
// 같은 룸의 유저들에게 자동으로 씬 로딩
PhotonNetwork.AutomaticallySyncScene = true;
// 같은 버전의 유저끼리 접속 허용
PhotonNetwork.GameVersion = version;
// 유저 아이디 할당
PhotonNetwork.NickName = GameManager.Instance.UserId;
// 포톤 서버와 통신 횟수 확인. 초당 30회
Debug.Log(PhotonNetwork.SendRate);
// 서버 접속
PhotonNetwork.ConnectUsingSettings();
}

// 포톤 서버에 접속 후 호출되는 콜백 함수
public override void OnConnectedToMaster()
{
// 잘 연결됐는지 확인
Debug.Log("서버와 연결 성공");
// 로비 입장했는지 확인, False
Debug.Log($"로비 입장 여부 = {PhotonNetwork.InLobby}");
// 로비 입장
PhotonNetwork.JoinLobby();
}

// 로비에 접속 후 호출되는 콜백 함수
public override void OnJoinedLobby()
{
// 로비 입장했는지 확인, True
Debug.Log($"로비 입장 여부 = {PhotonNetwork.InLobby}");
// 생성되어 있는 룸 중에서 랜덤하게 입장
PhotonNetwork.JoinRandomRoom();
}

// 랜덤 룸 입장에 실패했을 떄 호출되는 콜백 함수
public override void OnJoinRandomFailed(short returnCode, string message)
{
// 에러 메세지 출력
Debug.Log($"랜덤 룸 입장 실패 {returnCode}:{message}");

// 룸 속성 정의
RoomOptions ro = new RoomOptions();
ro.MaxPlayers = 8; // 최대 동접자 수: 8명
ro.IsOpen = true; // 룸의 오픈 여부
ro.IsVisible = true; // 로비에서 룸 목록 노출 여부

// 룸 생성
PhotonNetwork.CreateRoom("My Room", ro);
}

// 룸 생성이 완료된 후 호출되는 콜백 함수
public override void OnCreatedRoom()
{
Debug.Log("룸 생성");
Debug.Log($"룸 이름 = {PhotonNetwork.CurrentRoom.Name}");
}

// 룸에 입장한 후 호출되는 콜백 함수
public override void OnJoinedRoom()
{
//맵 구성

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
using Photon.Realtime;
public class PhotonManager : MonoBehaviourPunCallbacks
{
// 버전
private readonly string version = "1.0f";
void Awake()
{
Debug.Log("userID: " + GameManager.Instance.UserId);
// 같은 룸의 유저들에게 자동으로 씬 로딩
PhotonNetwork.AutomaticallySyncScene = true;
// 같은 버전의 유저끼리 접속 허용
PhotonNetwork.GameVersion = version;
// 유저 아이디 할당
PhotonNetwork.NickName = GameManager.Instance.UserId;
// 포톤 서버와 통신 횟수 확인. 초당 30회
Debug.Log(PhotonNetwork.SendRate);
// 서버 접속
PhotonNetwork.ConnectUsingSettings();
}
// 포톤 서버에 접속 후 호출되는 콜백 함수
public override void OnConnectedToMaster()
{
// 잘 연결됐는지 확인
Debug.Log("서버와 연결 성공");
// 로비 입장했는지 확인, False
Debug.Log($"로비 입장 여부 = {PhotonNetwork.InLobby}");
// 로비 입장
PhotonNetwork.JoinLobby();
}
// 로비에 접속 후 호출되는 콜백 함수
public override void OnJoinedLobby()
{
// 로비 입장했는지 확인, True
Debug.Log($"로비 입장 여부 = {PhotonNetwork.InLobby}");
// 생성되어 있는 룸 중에서 랜덤하게 입장
PhotonNetwork.JoinRandomRoom();
}
// 랜덤 룸 입장에 실패했을 떄 호출되는 콜백 함수
public override void OnJoinRandomFailed(short returnCode, string message)
{
// 에러 메세지 출력
Debug.Log($"랜덤 룸 입장 실패 {returnCode}:{message}");
// 룸 속성 정의
RoomOptions ro = new RoomOptions();
ro.MaxPlayers = 8; // 최대 동접자 수: 8명
ro.IsOpen = true; // 룸의 오픈 여부
ro.IsVisible = true; // 로비에서 룸 목록 노출 여부
// 룸 생성
PhotonNetwork.CreateRoom("My Room" + PhotonNetwork.NickName, ro);
}
// 룸 생성이 완료된 후 호출되는 콜백 함수
public override void OnCreatedRoom()
{
Debug.Log("룸 생성");
Debug.Log($"룸 이름 = {PhotonNetwork.CurrentRoom.Name}");
}
// 룸에 입장한 후 호출되는 콜백 함수
public override void OnJoinedRoom()
{
//맵 구성
if (PhotonNetwork.IsMasterClient)
{
Debug.Log("IsMasterClient 로써 맵 구성");
//MapManager.Instance.LocateBatterySpawner();//BatterySpawnerTargets 중 랜덤으로 스포너로 활성화
//MapManager.Instance.DisableSpawners_tmp();

MapManager.Instance.EnableBatterySpawner();
}



Debug.Log($"룸 입장 여부 = {PhotonNetwork.InRoom}");
Debug.Log($"현재 룸의 인원수 = {PhotonNetwork.CurrentRoom.PlayerCount}");

foreach (var player in PhotonNetwork.CurrentRoom.Players)
{
Debug.Log($"{player.Value.NickName}, {player.Value.ActorNumber}");
}

// 캐릭터 출현 정보 배열에 저장
Transform[] points = GameObject.Find("SpawnPointGroup").GetComponentsInChildren<Transform>();
int idx = Random.Range(1, points.Length);

// 캐릭터 생성
PhotonNetwork.Instantiate("Prefabs/Player", points[idx].position, points[idx].rotation, 0);

if (PhotonNetwork.CurrentRoom.PlayerCount >= 2)
{
Debug.Log("현재 인원수: " + PhotonNetwork.CurrentRoom.PlayerCount);
Debug.Log("Game Start!");

PhotonNetwork.CurrentRoom.IsOpen = false;
PhotonNetwork.CurrentRoom.IsVisible = false;

GameManager.Instance.TimerStart();

Debug.Log("현재 방 오픈 여부: " + PhotonNetwork.CurrentRoom.IsOpen);
}
}
}
}
Debug.Log($"룸 입장 여부 = {PhotonNetwork.InRoom}");
Debug.Log($"현재 룸의 인원수 = {PhotonNetwork.CurrentRoom.PlayerCount}");
foreach (var player in PhotonNetwork.CurrentRoom.Players)
{
Debug.Log($"{player.Value.NickName}, {player.Value.ActorNumber}");
}
// 캐릭터 출현 정보 배열에 저장
Transform[] points = GameObject.Find("SpawnPointGroup").GetComponentsInChildren<Transform>();
int idx = Random.Range(1, points.Length);
// 캐릭터 생성
PhotonNetwork.Instantiate("Prefabs/Player", points[idx].position, points[idx].rotation, 0);
if (PhotonNetwork.CurrentRoom.PlayerCount >= 2)
{
Debug.Log("현재 인원수: " + PhotonNetwork.CurrentRoom.PlayerCount);
Debug.Log("Game Start!");
PhotonNetwork.CurrentRoom.IsOpen = false;
PhotonNetwork.CurrentRoom.IsVisible = false;
GameManager.Instance.TimerStart();
Debug.Log("현재 방 오픈 여부: " + PhotonNetwork.CurrentRoom.IsOpen);
}
}
}