├── .gitignore ├── Assets ├── Plugins.meta └── Plugins │ ├── Pun2Task.meta │ └── Pun2Task │ ├── Callbacks.meta │ ├── Callbacks │ ├── PunCallbacksBridge.cs │ └── PunCallbacksBridge.cs.meta │ ├── Pun2Task.asmdef │ ├── Pun2Task.asmdef.meta │ ├── Pun2TaskCallback.cs │ ├── Pun2TaskCallback.cs.meta │ ├── Pun2TaskNetwork.cs │ ├── Pun2TaskNetwork.cs.meta │ ├── PunViewCallback.cs │ ├── PunViewCallback.cs.meta │ ├── package.json │ └── package.json.meta ├── LICENSE ├── Packages ├── manifest.json └── packages-lock.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── MemorySettings.asset ├── NavMeshAreas.asset ├── PackageManagerSettings.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset ├── VFXManager.asset ├── VersionControlSettings.asset └── XRSettings.asset ├── README.md └── UserSettings ├── EditorUserSettings.asset └── Search.settings /.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/ 3 | [Oo]bj/ 4 | [Bb]uild/ 5 | [Bb]uilds/ 6 | [Ll]ogs/ 7 | 8 | # Uncomment this line if you wish to ignore the asset store tools plugin 9 | # [Aa]ssets/AssetStoreTools* 10 | 11 | # Visual Studio cache directory 12 | .vs/ 13 | 14 | # Gradle cache directory 15 | .gradle/ 16 | 17 | # Autogenerated VS/MD/Consulo solution and project files 18 | ExportedObj/ 19 | .consulo/ 20 | *.csproj 21 | *.unityproj 22 | *.sln 23 | *.suo 24 | *.tmp 25 | *.user 26 | *.userprefs 27 | *.pidb 28 | *.booproj 29 | *.svd 30 | *.pdb 31 | *.mdb 32 | *.opendb 33 | *.VC.db 34 | 35 | # Unity3D generated meta files 36 | *.pidb.meta 37 | *.pdb.meta 38 | *.mdb.meta 39 | 40 | # Unity3D generated file on crash reports 41 | sysinfo.txt 42 | 43 | # Builds 44 | *.apk 45 | *.unitypackage 46 | 47 | # Crashlytics generated file 48 | crashlytics-build.properties 49 | 50 | # Photon 51 | 52 | Assets/Photon/ 53 | Assets/Photon.meta 54 | 55 | # Sandbox 56 | 57 | Assets/Sandbox/ 58 | Assets/Sandbox.meta -------------------------------------------------------------------------------- /Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b267120b7d70f1449c1bc23970a2e06 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Pun2Task.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc06ce6271eae004fbd4dba9a5e8ff25 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Pun2Task/Callbacks.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 690630b35dd3415e83438450bd980f95 3 | timeCreated: 1604385649 -------------------------------------------------------------------------------- /Assets/Plugins/Pun2Task/Callbacks/PunCallbacksBridge.cs: -------------------------------------------------------------------------------- 1 | #if PUN_TO_UNITASK_SUPPORT 2 | using System.Collections.Generic; 3 | using System.Threading; 4 | using Cysharp.Threading.Tasks; 5 | using ExitGames.Client.Photon; 6 | using Photon.Pun; 7 | using Photon.Realtime; 8 | 9 | namespace Pun2Task.Callbacks 10 | { 11 | internal sealed class PunCallbacksBridge : MonoBehaviourPunCallbacks 12 | { 13 | #region OnConnected 14 | 15 | private AsyncReactiveProperty _onConnected; 16 | 17 | public UniTask GetOnConnectedAsync(CancellationToken ct = default) 18 | { 19 | if (_onConnected == null) 20 | { 21 | _onConnected = new AsyncReactiveProperty(AsyncUnit.Default); 22 | _onConnected.AddTo(this.GetCancellationTokenOnDestroy()); 23 | } 24 | 25 | return _onConnected.WaitAsync(ct); 26 | } 27 | 28 | public override void OnConnected() 29 | { 30 | if (_onConnected != null) 31 | { 32 | _onConnected.Value = AsyncUnit.Default; 33 | } 34 | } 35 | 36 | #endregion 37 | 38 | #region OnLeftRoom 39 | 40 | private AsyncReactiveProperty _onLeftRoom; 41 | 42 | public UniTask GetOnLeftRoomAsync(CancellationToken ct = default) 43 | { 44 | if (_onLeftRoom == null) 45 | { 46 | _onLeftRoom = new AsyncReactiveProperty(AsyncUnit.Default); 47 | _onLeftRoom.AddTo(this.GetCancellationTokenOnDestroy()); 48 | } 49 | 50 | return _onLeftRoom.WaitAsync(ct); 51 | } 52 | 53 | 54 | public override void OnLeftRoom() 55 | { 56 | if (_onLeftRoom != null) 57 | { 58 | _onLeftRoom.Value = AsyncUnit.Default; 59 | } 60 | } 61 | 62 | #endregion 63 | 64 | #region OnMasterClientSwitched 65 | 66 | private AsyncReactiveProperty _onMasterClientSwitched; 67 | 68 | public UniTask GetOnMasterClientSwitchedAsync(CancellationToken ct = default) 69 | { 70 | if (_onMasterClientSwitched == null) 71 | { 72 | _onMasterClientSwitched = new AsyncReactiveProperty(default); 73 | _onMasterClientSwitched.AddTo(this.GetCancellationTokenOnDestroy()); 74 | } 75 | 76 | return _onMasterClientSwitched.WaitAsync(ct); 77 | } 78 | 79 | 80 | public override void OnMasterClientSwitched(Player newMasterClient) 81 | { 82 | if (_onMasterClientSwitched != null) 83 | { 84 | _onMasterClientSwitched.Value = newMasterClient; 85 | } 86 | } 87 | 88 | #endregion 89 | 90 | #region OnCreateRoomFailed 91 | 92 | private AsyncReactiveProperty<(short returnCode, string message)> _onCreateRoomFailed; 93 | 94 | public UniTask<(short returnCode, string message)> GetOnCreateRoomFailedAsync(CancellationToken ct = default) 95 | { 96 | if (_onCreateRoomFailed == null) 97 | { 98 | _onCreateRoomFailed = new AsyncReactiveProperty<(short returnCode, string message)>(default); 99 | _onCreateRoomFailed.AddTo(this.GetCancellationTokenOnDestroy()); 100 | } 101 | 102 | return _onCreateRoomFailed.WaitAsync(ct); 103 | } 104 | 105 | 106 | public override void OnCreateRoomFailed(short returnCode, string message) 107 | { 108 | if (_onCreateRoomFailed != null) 109 | { 110 | _onCreateRoomFailed.Value = (returnCode, message); 111 | } 112 | } 113 | 114 | #endregion 115 | 116 | #region OnJoinRoomFailed 117 | 118 | private AsyncReactiveProperty<(short returnCode, string message)> _onJoinRoomFailed; 119 | 120 | public UniTask<(short returnCode, string message)> GetOnJoinRoomFailedAsync(CancellationToken ct = default) 121 | { 122 | if (_onJoinRoomFailed == null) 123 | { 124 | _onJoinRoomFailed = new AsyncReactiveProperty<(short returnCode, string message)>(default); 125 | _onJoinRoomFailed.AddTo(this.GetCancellationTokenOnDestroy()); 126 | } 127 | 128 | return _onJoinRoomFailed.WaitAsync(ct); 129 | } 130 | 131 | 132 | public override void OnJoinRoomFailed(short returnCode, string message) 133 | { 134 | if (_onJoinRoomFailed != null) 135 | { 136 | _onJoinRoomFailed.Value = (returnCode, message); 137 | } 138 | } 139 | 140 | #endregion 141 | 142 | #region OnCreatedRoom 143 | 144 | private AsyncReactiveProperty _onCreatedRoom; 145 | 146 | public UniTask GetOnCreatedRoomAsync(CancellationToken ct = default) 147 | { 148 | if (_onCreatedRoom == null) 149 | { 150 | _onCreatedRoom = new AsyncReactiveProperty(AsyncUnit.Default); 151 | _onCreatedRoom.AddTo(this.GetCancellationTokenOnDestroy()); 152 | } 153 | 154 | return _onCreatedRoom.WaitAsync(ct); 155 | } 156 | 157 | 158 | public override void OnCreatedRoom() 159 | { 160 | if (_onCreatedRoom != null) 161 | { 162 | _onCreatedRoom.Value = AsyncUnit.Default; 163 | } 164 | } 165 | 166 | #endregion 167 | 168 | #region OnJoinedLobby 169 | 170 | private AsyncReactiveProperty _onJoinedLobby; 171 | 172 | public UniTask GetOnJoinedLobbyAsync(CancellationToken ct = default) 173 | { 174 | if (_onJoinedLobby == null) 175 | { 176 | _onJoinedLobby = new AsyncReactiveProperty(AsyncUnit.Default); 177 | _onJoinedLobby.AddTo(this.GetCancellationTokenOnDestroy()); 178 | } 179 | 180 | return _onJoinedLobby.WaitAsync(ct); 181 | } 182 | 183 | 184 | public override void OnJoinedLobby() 185 | { 186 | if (_onJoinedLobby != null) 187 | { 188 | _onJoinedLobby.Value = AsyncUnit.Default; 189 | } 190 | } 191 | 192 | #endregion 193 | 194 | #region OnLeftLobby 195 | 196 | private AsyncReactiveProperty _onLeftLobby; 197 | 198 | public UniTask GetOnLeftLobbyAsync(CancellationToken ct = default) 199 | { 200 | if (_onLeftLobby == null) 201 | { 202 | _onLeftLobby = new AsyncReactiveProperty(AsyncUnit.Default); 203 | _onLeftLobby.AddTo(this.GetCancellationTokenOnDestroy()); 204 | } 205 | 206 | return _onLeftLobby.WaitAsync(ct); 207 | } 208 | 209 | 210 | public override void OnLeftLobby() 211 | { 212 | if (_onLeftLobby != null) 213 | { 214 | _onLeftLobby.Value = AsyncUnit.Default; 215 | } 216 | } 217 | 218 | #endregion 219 | 220 | #region OnDisconnected 221 | 222 | private AsyncReactiveProperty _onDisconnected; 223 | 224 | public UniTask GetOnDisconnectedAsync(CancellationToken ct = default) 225 | { 226 | if (_onDisconnected == null) 227 | { 228 | _onDisconnected = new AsyncReactiveProperty(default); 229 | _onDisconnected.AddTo(this.GetCancellationTokenOnDestroy()); 230 | } 231 | 232 | return _onDisconnected.WaitAsync(ct); 233 | } 234 | 235 | 236 | public override void OnDisconnected(DisconnectCause cause) 237 | { 238 | if (_onDisconnected != null) 239 | { 240 | _onDisconnected.Value = cause; 241 | } 242 | } 243 | 244 | #endregion 245 | 246 | #region OnRegionListReceived 247 | 248 | private AsyncReactiveProperty _onRegionListReceived; 249 | 250 | public UniTask GetOnRegionListReceivedAsync(CancellationToken ct = default) 251 | { 252 | if (_onRegionListReceived == null) 253 | { 254 | _onRegionListReceived = new AsyncReactiveProperty(default); 255 | _onRegionListReceived.AddTo(this.GetCancellationTokenOnDestroy()); 256 | } 257 | 258 | return _onRegionListReceived.WaitAsync(ct); 259 | } 260 | 261 | public override void OnRegionListReceived(RegionHandler regionHandler) 262 | { 263 | if (_onRegionListReceived != null) 264 | { 265 | _onRegionListReceived.Value = regionHandler; 266 | } 267 | } 268 | 269 | #endregion 270 | 271 | #region OnRoomListUpdate 272 | 273 | private AsyncReactiveProperty> _onRoomListUpdate; 274 | 275 | public UniTask> GetOnRoomListUpdateAsync(CancellationToken ct = default) 276 | { 277 | if (_onRoomListUpdate == null) 278 | { 279 | _onRoomListUpdate = new AsyncReactiveProperty>(default); 280 | _onRoomListUpdate.AddTo(this.GetCancellationTokenOnDestroy()); 281 | } 282 | 283 | return _onRoomListUpdate.WaitAsync(ct); 284 | } 285 | 286 | 287 | public override void OnRoomListUpdate(List roomList) 288 | { 289 | if (_onRoomListUpdate != null) 290 | { 291 | _onRoomListUpdate.Value = roomList; 292 | } 293 | } 294 | 295 | #endregion 296 | 297 | #region OnJoinedRoom 298 | 299 | private AsyncReactiveProperty _onJoinedRoom; 300 | 301 | public UniTask GetOnJoinedRoomAsync(CancellationToken ct = default) 302 | { 303 | if (_onJoinedRoom == null) 304 | { 305 | _onJoinedRoom = new AsyncReactiveProperty(AsyncUnit.Default); 306 | _onJoinedRoom.AddTo(this.GetCancellationTokenOnDestroy()); 307 | } 308 | 309 | return _onJoinedRoom.WaitAsync(ct); 310 | } 311 | 312 | 313 | public override void OnJoinedRoom() 314 | { 315 | if (_onJoinedRoom != null) 316 | { 317 | _onJoinedRoom.Value = AsyncUnit.Default; 318 | } 319 | } 320 | 321 | #endregion 322 | 323 | #region OnPlayerEnteredRoom 324 | 325 | private AsyncReactiveProperty _onPlayerEnteredRoom; 326 | 327 | public UniTask GetOnPlayerEnteredRoomAsync(CancellationToken ct = default) 328 | { 329 | if (_onPlayerEnteredRoom == null) 330 | { 331 | _onPlayerEnteredRoom = new AsyncReactiveProperty(default); 332 | _onPlayerEnteredRoom.AddTo(this.GetCancellationTokenOnDestroy()); 333 | } 334 | 335 | return _onPlayerEnteredRoom.WaitAsync(ct); 336 | } 337 | 338 | public IUniTaskAsyncEnumerable OnPlayerEnteredRoomAsyncEnumerable 339 | { 340 | get 341 | { 342 | if (_onPlayerEnteredRoom == null) 343 | { 344 | _onPlayerEnteredRoom = new AsyncReactiveProperty(default); 345 | _onPlayerEnteredRoom.AddTo(this.GetCancellationTokenOnDestroy()); 346 | return _onPlayerEnteredRoom.WithoutCurrent(); 347 | } 348 | 349 | return _onPlayerEnteredRoom; 350 | } 351 | } 352 | 353 | 354 | public override void OnPlayerEnteredRoom(Player newPlayer) 355 | { 356 | if (_onPlayerEnteredRoom != null) 357 | { 358 | _onPlayerEnteredRoom.Value = newPlayer; 359 | } 360 | } 361 | 362 | #endregion 363 | 364 | #region OnPlayerLeftRoom 365 | 366 | private AsyncReactiveProperty _onPlayerLeftRoom; 367 | 368 | public UniTask GetOnPlayerLeftRoomAsync(CancellationToken ct = default) 369 | { 370 | if (_onPlayerLeftRoom == null) 371 | { 372 | _onPlayerLeftRoom = new AsyncReactiveProperty(default); 373 | _onPlayerLeftRoom.AddTo(this.GetCancellationTokenOnDestroy()); 374 | } 375 | 376 | return _onPlayerLeftRoom.WaitAsync(ct); 377 | } 378 | 379 | public IUniTaskAsyncEnumerable OnPlayerLeftRoomAsyncEnumerable 380 | { 381 | get 382 | { 383 | if (_onPlayerLeftRoom == null) 384 | { 385 | _onPlayerLeftRoom = new AsyncReactiveProperty(default); 386 | _onPlayerLeftRoom.AddTo(this.GetCancellationTokenOnDestroy()); 387 | return _onPlayerLeftRoom.WithoutCurrent(); 388 | } 389 | 390 | return _onPlayerLeftRoom; 391 | } 392 | } 393 | 394 | 395 | public override void OnPlayerLeftRoom(Player otherPlayer) 396 | { 397 | if (_onPlayerLeftRoom != null) 398 | { 399 | _onPlayerLeftRoom.Value = otherPlayer; 400 | } 401 | } 402 | 403 | #endregion 404 | 405 | #region OnJoinRandomFailed 406 | 407 | private AsyncReactiveProperty<(short returnCode, string message)> _onJoinRandomFailed; 408 | 409 | public UniTask<(short returnCode, string message)> GetOnJoinRandomFailedAsync(CancellationToken ct = default) 410 | { 411 | if (_onJoinRandomFailed == null) 412 | { 413 | _onJoinRandomFailed = new AsyncReactiveProperty<(short returnCode, string message)>(default); 414 | _onJoinRandomFailed.AddTo(this.GetCancellationTokenOnDestroy()); 415 | } 416 | 417 | return _onJoinRandomFailed.WaitAsync(ct); 418 | } 419 | 420 | 421 | public override void OnJoinRandomFailed(short returnCode, string message) 422 | { 423 | if (_onJoinRandomFailed != null) 424 | { 425 | _onJoinRandomFailed.Value = (returnCode, message); 426 | } 427 | } 428 | 429 | #endregion 430 | 431 | #region OnConnectedToMasterAsync 432 | 433 | private AsyncReactiveProperty _onConnectedToMaster; 434 | 435 | public UniTask GetOnConnectedToMasterAsync(CancellationToken ct = default) 436 | { 437 | if (_onConnectedToMaster == null) 438 | { 439 | _onConnectedToMaster = new AsyncReactiveProperty(AsyncUnit.Default); 440 | _onConnectedToMaster.AddTo(this.GetCancellationTokenOnDestroy()); 441 | } 442 | 443 | return _onConnectedToMaster.WaitAsync(ct); 444 | } 445 | 446 | 447 | public override void OnConnectedToMaster() 448 | { 449 | if (_onConnectedToMaster != null) 450 | { 451 | _onConnectedToMaster.Value = AsyncUnit.Default; 452 | } 453 | } 454 | 455 | #endregion 456 | 457 | #region OnRoomPropertiesUpdate 458 | 459 | private AsyncReactiveProperty _onRoomPropertiesUpdate; 460 | 461 | public UniTask GetOnRoomPropertiesUpdateAsync(CancellationToken ct = default) 462 | { 463 | if (_onRoomPropertiesUpdate == null) 464 | { 465 | _onRoomPropertiesUpdate = new AsyncReactiveProperty(default); 466 | _onRoomPropertiesUpdate.AddTo(this.GetCancellationTokenOnDestroy()); 467 | } 468 | 469 | return _onRoomPropertiesUpdate.WaitAsync(ct); 470 | } 471 | 472 | 473 | public override void OnRoomPropertiesUpdate(Hashtable propertiesThatChanged) 474 | { 475 | if (_onRoomPropertiesUpdate != null) 476 | { 477 | _onRoomPropertiesUpdate.Value = propertiesThatChanged; 478 | } 479 | } 480 | 481 | #endregion 482 | 483 | #region OnPlayerPropertiesUpdate 484 | 485 | private AsyncReactiveProperty<(Player targetPlayer, Hashtable changedProps)> _onPlayerPropertiesUpdate; 486 | 487 | public UniTask<(Player targetPlayer, Hashtable changedProps)> GetOnPlayerPropertiesUpdateAsync( 488 | CancellationToken ct = default) 489 | { 490 | if (_onPlayerPropertiesUpdate == null) 491 | { 492 | _onPlayerPropertiesUpdate = 493 | new AsyncReactiveProperty<(Player targetPlayer, Hashtable changedProps)>(default); 494 | _onPlayerPropertiesUpdate.AddTo(this.GetCancellationTokenOnDestroy()); 495 | } 496 | 497 | return _onPlayerPropertiesUpdate.WaitAsync(ct); 498 | } 499 | 500 | 501 | public override void OnPlayerPropertiesUpdate(Player targetPlayer, Hashtable changedProps) 502 | { 503 | if (_onPlayerPropertiesUpdate != null) 504 | { 505 | _onPlayerPropertiesUpdate.Value = (targetPlayer, changedProps); 506 | } 507 | } 508 | 509 | #endregion 510 | 511 | #region OnFriendListUpdate 512 | 513 | private AsyncReactiveProperty> _onFriendListUpdate; 514 | 515 | public UniTask> GetOnFriendListUpdateAsync(CancellationToken ct = default) 516 | { 517 | if (_onFriendListUpdate == null) 518 | { 519 | _onFriendListUpdate = new AsyncReactiveProperty>(default); 520 | _onFriendListUpdate.AddTo(this.GetCancellationTokenOnDestroy()); 521 | } 522 | 523 | return _onFriendListUpdate.WaitAsync(ct); 524 | } 525 | 526 | 527 | public override void OnFriendListUpdate(List friendList) 528 | { 529 | if (_onFriendListUpdate != null) 530 | { 531 | _onFriendListUpdate.Value = friendList; 532 | } 533 | } 534 | 535 | #endregion 536 | 537 | #region OnCustomAuthenticationResponse 538 | 539 | private AsyncReactiveProperty> _onCustomAuthenticationResponse; 540 | 541 | public UniTask> GetOnCustomAuthenticationResponseAsync( 542 | CancellationToken ct = default) 543 | { 544 | if (_onCustomAuthenticationResponse == null) 545 | { 546 | _onCustomAuthenticationResponse = 547 | new AsyncReactiveProperty>(default); 548 | _onCustomAuthenticationResponse.AddTo(this.GetCancellationTokenOnDestroy()); 549 | } 550 | 551 | return _onCustomAuthenticationResponse.WaitAsync(ct); 552 | } 553 | 554 | 555 | public override void OnCustomAuthenticationResponse(Dictionary data) 556 | { 557 | if (_onCustomAuthenticationResponse != null) 558 | { 559 | _onCustomAuthenticationResponse.Value = data; 560 | } 561 | } 562 | 563 | #endregion 564 | 565 | #region OnCustomAuthenticationFailed 566 | 567 | private AsyncReactiveProperty _onCustomAuthenticationFailed; 568 | 569 | public UniTask GetOnCustomAuthenticationFailedAsync(CancellationToken ct = default) 570 | { 571 | if (_onCustomAuthenticationFailed == null) 572 | { 573 | _onCustomAuthenticationFailed = new AsyncReactiveProperty(default); 574 | _onCustomAuthenticationFailed.AddTo(this.GetCancellationTokenOnDestroy()); 575 | } 576 | 577 | return _onCustomAuthenticationFailed.WaitAsync(ct); 578 | } 579 | 580 | 581 | public override void OnCustomAuthenticationFailed(string debugMessage) 582 | { 583 | if (_onCustomAuthenticationFailed != null) 584 | { 585 | _onCustomAuthenticationFailed.Value = debugMessage; 586 | } 587 | } 588 | 589 | #endregion 590 | 591 | #region OnWebRpcResponse 592 | 593 | private AsyncReactiveProperty _onWebRpcResponse; 594 | 595 | public UniTask GetOnWebRpcResponseAsync(CancellationToken ct = default) 596 | { 597 | if (_onWebRpcResponse == null) 598 | { 599 | _onWebRpcResponse = new AsyncReactiveProperty(default); 600 | _onWebRpcResponse.AddTo(this.GetCancellationTokenOnDestroy()); 601 | } 602 | 603 | return _onWebRpcResponse.WaitAsync(ct); 604 | } 605 | 606 | 607 | public override void OnWebRpcResponse(OperationResponse response) 608 | { 609 | if (_onWebRpcResponse != null) 610 | { 611 | _onWebRpcResponse.Value = response; 612 | } 613 | } 614 | 615 | #endregion 616 | 617 | #region OnLobbyStatisticsUpdate 618 | 619 | private AsyncReactiveProperty> _onLobbyStatisticsUpdate; 620 | 621 | public UniTask> GetOnLobbyStatisticsUpdateAsync(CancellationToken ct = default) 622 | { 623 | if (_onLobbyStatisticsUpdate == null) 624 | { 625 | _onLobbyStatisticsUpdate = new AsyncReactiveProperty>(default); 626 | _onLobbyStatisticsUpdate.AddTo(this.GetCancellationTokenOnDestroy()); 627 | } 628 | 629 | return _onLobbyStatisticsUpdate.WaitAsync(ct); 630 | } 631 | 632 | 633 | public override void OnLobbyStatisticsUpdate(List lobbyStatistics) 634 | { 635 | if (_onLobbyStatisticsUpdate != null) 636 | { 637 | _onLobbyStatisticsUpdate.Value = lobbyStatistics; 638 | } 639 | } 640 | 641 | #endregion 642 | 643 | #region OnErrorInfo 644 | 645 | private AsyncReactiveProperty _onErrorInfo; 646 | 647 | public UniTask GetOnErrorInfoAsync(CancellationToken ct = default) 648 | { 649 | if (_onErrorInfo == null) 650 | { 651 | _onErrorInfo = new AsyncReactiveProperty(default); 652 | _onErrorInfo.AddTo(this.GetCancellationTokenOnDestroy()); 653 | } 654 | 655 | return _onErrorInfo.WaitAsync(ct); 656 | } 657 | 658 | public override void OnErrorInfo(ErrorInfo errorInfo) 659 | { 660 | if (_onErrorInfo != null) 661 | { 662 | _onErrorInfo.Value = errorInfo; 663 | } 664 | } 665 | 666 | #endregion 667 | } 668 | } 669 | #endif -------------------------------------------------------------------------------- /Assets/Plugins/Pun2Task/Callbacks/PunCallbacksBridge.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0c2bc39b0895437eb72541c2a225d189 3 | timeCreated: 1604385649 -------------------------------------------------------------------------------- /Assets/Plugins/Pun2Task/Pun2Task.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Pun2Task", 3 | "references": [ 4 | "GUID:f51ebe6a0ceec4240a699833d6309b23", 5 | "GUID:57c32fc907df0f54e8e6e8f0d2488336", 6 | "GUID:831409e8f9d13b5479a3baef9822ad34", 7 | "GUID:5c01796d064528144a599661eaab93a6" 8 | ], 9 | "includePlatforms": [], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": false, 13 | "precompiledReferences": [], 14 | "autoReferenced": true, 15 | "defineConstraints": [], 16 | "versionDefines": [ 17 | { 18 | "name": "com.cysharp.unitask", 19 | "expression": "", 20 | "define": "PUN_TO_UNITASK_SUPPORT" 21 | } 22 | ], 23 | "noEngineReferences": false 24 | } -------------------------------------------------------------------------------- /Assets/Plugins/Pun2Task/Pun2Task.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eaa3727e50bd36d428d0feead3d6ea4c 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Plugins/Pun2Task/Pun2TaskCallback.cs: -------------------------------------------------------------------------------- 1 | #if PUN_TO_UNITASK_SUPPORT 2 | 3 | using System.Collections.Generic; 4 | using System.Threading; 5 | using Cysharp.Threading.Tasks; 6 | using ExitGames.Client.Photon; 7 | using Photon.Pun; 8 | using Photon.Realtime; 9 | using Pun2Task.Callbacks; 10 | using UnityEngine; 11 | 12 | namespace Pun2Task 13 | { 14 | public static class Pun2TaskCallback 15 | { 16 | /// 17 | /// Called to signal that the raw connection got established but before the client can call operation on the server. 18 | /// 19 | /// 20 | /// After the (low level transport) connection is established, the client will automatically send 21 | /// the Authentication operation, which needs to get a response before the client can call other operations. 22 | /// 23 | /// Your logic should wait for either: OnRegionListReceived or OnConnectedToMaster. 24 | /// 25 | /// This callback is useful to detect if the server can be reached at all (technically). 26 | /// Most often, it's enough to implement OnDisconnected(). 27 | /// 28 | /// This is not called for transitions from the masterserver to game servers. 29 | /// 30 | public static UniTask OnConnectedAsync(CancellationToken ct = default) 31 | { 32 | return GetBridge().GetOnConnectedAsync(ct); 33 | } 34 | 35 | /// 36 | /// Called when the local user/client left a room, so the game's logic can clean up it's internal state. 37 | /// 38 | /// 39 | /// When leaving a room, the LoadBalancingClient will disconnect the Game Server and connect to the Master Server. 40 | /// This wraps up multiple internal actions. 41 | /// 42 | /// Wait for the callback OnConnectedToMaster, before you use lobbies and join or create rooms. 43 | /// 44 | public static UniTask OnLeftRoomAsync(CancellationToken ct = default) 45 | { 46 | return GetBridge().GetOnLeftRoomAsync(ct); 47 | } 48 | 49 | /// 50 | /// Called after switching to a new MasterClient when the current one leaves. 51 | /// 52 | /// 53 | /// This is not called when this client enters a room. 54 | /// The former MasterClient is still in the player list when this method get called. 55 | /// 56 | public static UniTask OnMasterClientSwitchedAsync(CancellationToken ct = default) 57 | { 58 | return GetBridge().GetOnMasterClientSwitchedAsync(ct); 59 | } 60 | 61 | /// 62 | /// Called when the server couldn't create a room (OpCreateRoom failed). 63 | /// 64 | /// 65 | /// The most common cause to fail creating a room, is when a title relies on fixed room-names and the room already exists. 66 | /// 67 | public static UniTask<(short returnCode, string message)> OnCreateRoomFailedAsync(CancellationToken ct = default) 68 | { 69 | return GetBridge().GetOnCreateRoomFailedAsync(ct); 70 | } 71 | 72 | /// 73 | /// Called when a previous OpJoinRoom call failed on the server. 74 | /// 75 | /// 76 | /// The most common causes are that a room is full or does not exist (due to someone else being faster or closing the room). 77 | /// 78 | public static UniTask<(short returnCode, string message)> OnJoinRoomFailedAsync(CancellationToken ct = default) 79 | { 80 | return GetBridge().GetOnJoinRoomFailedAsync(ct); 81 | } 82 | 83 | /// 84 | /// Called when this client created a room and entered it. OnJoinedRoom() will be called as well. 85 | /// 86 | /// 87 | /// This callback is only called on the client which created a room (see OpCreateRoom). 88 | /// 89 | /// As any client might close (or drop connection) anytime, there is a chance that the 90 | /// creator of a room does not execute OnCreatedRoom. 91 | /// 92 | /// If you need specific room properties or a "start signal", implement OnMasterClientSwitched() 93 | /// and make each new MasterClient check the room's state. 94 | /// 95 | public static UniTask OnCreatedRoomAsync(CancellationToken ct = default) 96 | { 97 | return GetBridge().GetOnCreatedRoomAsync(ct); 98 | } 99 | 100 | /// 101 | /// Called on entering a lobby on the Master Server. The actual room-list updates will call OnRoomListUpdate. 102 | /// 103 | /// 104 | /// While in the lobby, the roomlist is automatically updated in fixed intervals (which you can't modify in the public cloud). 105 | /// The room list gets available via OnRoomListUpdate. 106 | /// 107 | public static UniTask OnJoinedLobbyAsync(CancellationToken ct = default) 108 | { 109 | return GetBridge().GetOnJoinedLobbyAsync(ct); 110 | } 111 | 112 | /// 113 | /// Called after leaving a lobby. 114 | /// 115 | /// 116 | /// When you leave a lobby, [OpCreateRoom](@ref OpCreateRoom) and [OpJoinRandomRoom](@ref OpJoinRandomRoom) 117 | /// automatically refer to the default lobby. 118 | /// 119 | public static UniTask OnLeftLobbyAsync(CancellationToken ct = default) 120 | { 121 | return GetBridge().GetOnLeftLobbyAsync(ct); 122 | } 123 | 124 | /// 125 | /// Called after disconnecting from the Photon server. It could be a failure or intentional 126 | /// 127 | /// 128 | /// The reason for this disconnect is provided as DisconnectCause. 129 | /// 130 | public static UniTask OnDisconnectedAsync(CancellationToken ct = default) 131 | { 132 | return GetBridge().GetOnDisconnectedAsync(ct); 133 | } 134 | 135 | 136 | /// 137 | /// Called when the Name Server provided a list of regions for your title. 138 | /// 139 | /// Check the RegionHandler class description, to make use of the provided values. 140 | public static UniTask OnRegionListReceivedAsync(CancellationToken ct = default) 141 | { 142 | return GetBridge().GetOnRegionListReceivedAsync(ct); 143 | } 144 | 145 | /// 146 | /// Called for any update of the room-listing while in a lobby (InLobby) on the Master Server. 147 | /// 148 | /// 149 | /// Each item is a RoomInfo which might include custom properties (provided you defined those as lobby-listed when creating a room). 150 | /// Not all types of lobbies provide a listing of rooms to the client. Some are silent and specialized for server-side matchmaking. 151 | /// 152 | public static UniTask> OnRoomListUpdateAsync(CancellationToken ct = default) 153 | { 154 | return GetBridge().GetOnRoomListUpdateAsync(ct); 155 | } 156 | 157 | /// 158 | /// Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined. 159 | /// 160 | /// 161 | /// When this is called, you can access the existing players in Room.Players, their custom properties and Room.CustomProperties. 162 | /// 163 | /// In this callback, you could create player objects. For example in Unity, instantiate a prefab for the player. 164 | /// 165 | /// If you want a match to be started "actively", enable the user to signal "ready" (using OpRaiseEvent or a Custom Property). 166 | /// 167 | public static UniTask OnJoinedRoomAsync(CancellationToken ct = default) 168 | { 169 | return GetBridge().GetOnJoinedRoomAsync(ct); 170 | } 171 | 172 | /// 173 | /// Called when a remote player entered the room. This Player is already added to the playerlist. 174 | /// 175 | /// 176 | /// If your game starts with a certain number of players, this callback can be useful to check the 177 | /// Room.playerCount and find out if you can start. 178 | /// 179 | public static UniTask OnPlayerEnteredRoomAsync(CancellationToken ct = default) 180 | { 181 | return GetBridge().GetOnPlayerEnteredRoomAsync(ct); 182 | } 183 | 184 | /// 185 | /// Called when a remote player entered the room. This Player is already added to the playerlist. 186 | /// 187 | /// 188 | /// If your game starts with a certain number of players, this callback can be useful to check the 189 | /// Room.playerCount and find out if you can start. 190 | /// 191 | public static IUniTaskAsyncEnumerable OnPlayerEnteredRoomAsyncEnumerable() 192 | { 193 | return GetBridge().OnPlayerEnteredRoomAsyncEnumerable; 194 | } 195 | 196 | /// 197 | /// Called when a remote player left the room or became inactive. Check otherPlayer.IsInactive. 198 | /// 199 | /// 200 | /// If another player leaves the room or if the server detects a lost connection, this callback will 201 | /// be used to notify your game logic. 202 | /// 203 | /// Depending on the room's setup, players may become inactive, which means they may return and retake 204 | /// their spot in the room. In such cases, the Player stays in the Room.Players dictionary. 205 | /// 206 | /// If the player is not just inactive, it gets removed from the Room.Players dictionary, before 207 | /// the callback is called. 208 | /// 209 | public static UniTask OnPlayerLeftRoomAsync(CancellationToken ct = default) 210 | { 211 | return GetBridge().GetOnPlayerLeftRoomAsync(ct); 212 | } 213 | 214 | /// 215 | /// Called when a remote player left the room or became inactive. Check otherPlayer.IsInactive. 216 | /// 217 | /// 218 | /// If another player leaves the room or if the server detects a lost connection, this callback will 219 | /// be used to notify your game logic. 220 | /// 221 | /// Depending on the room's setup, players may become inactive, which means they may return and retake 222 | /// their spot in the room. In such cases, the Player stays in the Room.Players dictionary. 223 | /// 224 | /// If the player is not just inactive, it gets removed from the Room.Players dictionary, before 225 | /// the callback is called. 226 | /// 227 | public static IUniTaskAsyncEnumerable OnPlayerLeftRoomAsyncEnumerable() 228 | { 229 | return GetBridge().OnPlayerLeftRoomAsyncEnumerable; 230 | } 231 | 232 | 233 | /// 234 | /// Called when a previous OpJoinRandom call failed on the server. 235 | /// 236 | /// 237 | /// The most common causes are that a room is full or does not exist (due to someone else being faster or closing the room). 238 | /// 239 | /// When using multiple lobbies (via OpJoinLobby or a TypedLobby parameter), another lobby might have more/fitting rooms.
240 | ///
241 | public static UniTask<(short returnCode, string message)> OnJoinRandomFailedAsync(CancellationToken ct = default) 242 | { 243 | return GetBridge().GetOnJoinRandomFailedAsync(ct); 244 | } 245 | 246 | /// 247 | /// Called when the client is connected to the Master Server and ready for matchmaking and other tasks. 248 | /// 249 | /// 250 | /// The list of available rooms won't become available unless you join a lobby via LoadBalancingClient.OpJoinLobby. 251 | /// You can join rooms and create them even without being in a lobby. The default lobby is used in that case. 252 | /// 253 | public static async UniTask OnConnectedToMasterAsync(CancellationToken ct = default) 254 | { 255 | if (PhotonNetwork.NetworkClientState == ClientState.ConnectedToMasterServer) return; 256 | await GetBridge().GetOnConnectedToMasterAsync(ct); 257 | } 258 | 259 | /// 260 | /// Called when a room's custom properties changed. The propertiesThatChanged contains all that was set via Room.SetCustomProperties. 261 | /// 262 | /// 263 | /// Since v1.25 this method has one parameter: Hashtable propertiesThatChanged.
264 | /// Changing properties must be done by Room.SetCustomProperties, which causes this callback locally, too. 265 | ///
266 | public static UniTask OnRoomPropertiesUpdateAsync(CancellationToken ct = default) 267 | { 268 | return GetBridge().GetOnRoomPropertiesUpdateAsync(ct); 269 | } 270 | 271 | /// 272 | /// Called when custom player-properties are changed. Player and the changed properties are passed as object[]. 273 | /// 274 | /// 275 | /// Changing properties must be done by Player.SetCustomProperties, which causes this callback locally, too. 276 | /// 277 | public static UniTask<(Player targetPlayer, Hashtable changedProps)> OnPlayerPropertiesUpdateAsync(CancellationToken ct = default) 278 | { 279 | return GetBridge().GetOnPlayerPropertiesUpdateAsync(ct); 280 | } 281 | 282 | /// 283 | /// Called when the server sent the response to a FindFriends request. 284 | /// 285 | /// 286 | /// After calling OpFindFriends, the Master Server will cache the friend list and send updates to the friend 287 | /// list. The friends includes the name, userId, online state and the room (if any) for each requested user/friend. 288 | /// 289 | /// Use the friendList to update your UI and store it, if the UI should highlight changes. 290 | /// 291 | public static UniTask> OnFriendListUpdateAsync(CancellationToken ct = default) 292 | { 293 | return GetBridge().GetOnFriendListUpdateAsync(ct); 294 | } 295 | 296 | /// 297 | /// Called when your Custom Authentication service responds with additional data. 298 | /// 299 | /// 300 | /// Custom Authentication services can include some custom data in their response. 301 | /// When present, that data is made available in this callback as Dictionary. 302 | /// While the keys of your data have to be strings, the values can be either string or a number (in Json). 303 | /// You need to make extra sure, that the value type is the one you expect. Numbers become (currently) int64. 304 | /// 305 | /// Example: void OnCustomAuthenticationResponse(Dictionary<string, object> data) { ... } 306 | /// 307 | /// 308 | public static UniTask> OnCustomAuthenticationResponseAsync(CancellationToken ct = default) 309 | { 310 | return GetBridge().GetOnCustomAuthenticationResponseAsync(ct); 311 | } 312 | 313 | /// 314 | /// Called when the custom authentication failed. Followed by disconnect! 315 | /// 316 | /// 317 | /// Custom Authentication can fail due to user-input, bad tokens/secrets. 318 | /// If authentication is successful, this method is not called. Implement OnJoinedLobby() or OnConnectedToMaster() (as usual). 319 | /// 320 | /// During development of a game, it might also fail due to wrong configuration on the server side. 321 | /// In those cases, logging the debugMessage is very important. 322 | /// 323 | /// Unless you setup a custom authentication service for your app (in the [Dashboard](https://dashboard.photonengine.com)), 324 | /// this won't be called! 325 | /// 326 | public static UniTask OnCustomAuthenticationFailedAsync(CancellationToken ct = default) 327 | { 328 | return GetBridge().GetOnCustomAuthenticationFailedAsync(ct); 329 | } 330 | 331 | //TODO: Check if this needs to be implemented 332 | // in: IOptionalInfoCallbacks 333 | public static UniTask OnWebRpcResponseAsync(CancellationToken ct = default) 334 | { 335 | return GetBridge().GetOnWebRpcResponseAsync(ct); 336 | } 337 | 338 | //TODO: Check if this needs to be implemented 339 | // in: IOptionalInfoCallbacks 340 | public static UniTask> OnLobbyStatisticsUpdateAsync(CancellationToken ct = default) 341 | { 342 | return GetBridge().GetOnLobbyStatisticsUpdateAsync(ct); 343 | } 344 | 345 | /// 346 | /// Called when the client receives an event from the server indicating that an error happened there. 347 | /// 348 | /// 349 | /// In most cases this could be either: 350 | /// 1. an error from webhooks plugin (if HasErrorInfo is enabled), read more here: 351 | /// https://doc.photonengine.com/en-us/realtime/current/gameplay/web-extensions/webhooks#options 352 | /// 2. an error sent from a custom server plugin via PluginHost.BroadcastErrorInfoEvent, see example here: 353 | /// https://doc.photonengine.com/en-us/server/current/plugins/manual#handling_http_response 354 | /// 3. an error sent from the server, for example, when the limit of cached events has been exceeded in the room 355 | /// (all clients will be disconnected and the room will be closed in this case) 356 | /// read more here: https://doc.photonengine.com/en-us/realtime/current/gameplay/cached-events#special_considerations 357 | /// 358 | /// object containing information about the error 359 | public static UniTask OnErrorInfoAsync(CancellationToken ct = default) 360 | { 361 | return GetBridge().GetOnErrorInfoAsync(ct); 362 | } 363 | 364 | 365 | #region Bridge 366 | 367 | private static PunCallbacksBridge _instance; 368 | 369 | private static PunCallbacksBridge GetBridge() 370 | { 371 | if (_instance != null) return _instance; 372 | 373 | var gameObject = new GameObject { name = "Pun2TaskCallback" }; 374 | Object.DontDestroyOnLoad(gameObject); 375 | _instance = gameObject.AddComponent(); 376 | return _instance; 377 | } 378 | 379 | #endregion 380 | } 381 | } 382 | #endif -------------------------------------------------------------------------------- /Assets/Plugins/Pun2Task/Pun2TaskCallback.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 700aa637151f4550880aa1d9de781a50 3 | timeCreated: 1604386226 -------------------------------------------------------------------------------- /Assets/Plugins/Pun2Task/Pun2TaskNetwork.cs: -------------------------------------------------------------------------------- 1 | #if PUN_TO_UNITASK_SUPPORT 2 | 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Threading; 6 | using Cysharp.Threading.Tasks; 7 | using ExitGames.Client.Photon; 8 | using Photon.Pun; 9 | using Photon.Realtime; 10 | 11 | namespace Pun2Task 12 | { 13 | public static class Pun2TaskNetwork 14 | { 15 | #region ServerConnection 16 | 17 | /// 18 | /// PhotonNetwork.ConnectUsingSettings 19 | /// 20 | /// 21 | /// Throws when PhotonNetwork.ConnectUsingSettings returns false. 22 | /// Throw when connection to server fails. 23 | public static async UniTask ConnectUsingSettingsAsync(CancellationToken token = default) 24 | { 25 | var cts = CancellationTokenSource.CreateLinkedTokenSource(token); 26 | try 27 | { 28 | var task = UniTask.WhenAny( 29 | Pun2TaskCallback.OnConnectedToMasterAsync(cts.Token).AsAsyncUnitUniTask(), 30 | Pun2TaskCallback.OnDisconnectedAsync(cts.Token)); 31 | 32 | var result = PhotonNetwork.ConnectUsingSettings(); 33 | if (!result) 34 | { 35 | throw new InvalidNetworkOperationException(nameof(ConnectUsingSettingsAsync) + 36 | " is not ready to connect."); 37 | } 38 | 39 | var (winIndex, _, disconnectCause) = await task; 40 | 41 | if (winIndex == 0) return; 42 | throw new ConnectionFailedException(disconnectCause); 43 | } 44 | finally 45 | { 46 | cts.Cancel(); 47 | cts.Dispose(); 48 | } 49 | } 50 | 51 | /// 52 | /// PhotonNetwork.ConnectUsingSettings 53 | /// 54 | /// 55 | /// 56 | /// 57 | /// Throws when PhotonNetwork.ConnectUsingSettings returns false. 58 | /// Throw when connection to server fails. 59 | public static async UniTask ConnectUsingSettingsAsync( 60 | AppSettings appSettings, 61 | bool startInOfflineMode = false, 62 | CancellationToken token = default) 63 | { 64 | var cts = CancellationTokenSource.CreateLinkedTokenSource(token); 65 | try 66 | { 67 | var task = UniTask.WhenAny( 68 | Pun2TaskCallback.OnConnectedToMasterAsync(cts.Token).AsAsyncUnitUniTask(), 69 | Pun2TaskCallback.OnDisconnectedAsync(cts.Token)); 70 | 71 | var result = PhotonNetwork.ConnectUsingSettings(appSettings, startInOfflineMode); 72 | if (!result) 73 | { 74 | throw new InvalidNetworkOperationException(nameof(ConnectUsingSettingsAsync) + 75 | " is not ready to connect."); 76 | } 77 | 78 | var (winIndex, _, disconnectCause) = await task; 79 | 80 | if (winIndex == 0) return; 81 | throw new ConnectionFailedException(disconnectCause); 82 | } 83 | finally 84 | { 85 | cts.Cancel(); 86 | cts.Dispose(); 87 | } 88 | } 89 | 90 | /// 91 | /// 92 | /// 93 | /// 94 | /// 95 | /// 96 | /// 97 | /// Throws when PhotonNetwork.ConnectToMaster returns false. 98 | /// Throw when connection to server fails. 99 | public static async UniTask ConnectToMasterAsync( 100 | string masterServerAddress, 101 | int port, 102 | string appID, 103 | CancellationToken token = default) 104 | { 105 | var cts = CancellationTokenSource.CreateLinkedTokenSource(token); 106 | try 107 | { 108 | var task = UniTask.WhenAny( 109 | Pun2TaskCallback.OnConnectedToMasterAsync(cts.Token).AsAsyncUnitUniTask(), 110 | Pun2TaskCallback.OnDisconnectedAsync(cts.Token)); 111 | 112 | var result = PhotonNetwork.ConnectToMaster(masterServerAddress, port, appID); 113 | if (!result) 114 | { 115 | throw new InvalidNetworkOperationException(nameof(ConnectToMasterAsync) + 116 | " is not ready to connect."); 117 | } 118 | 119 | var (winIndex, _, disconnectCause) = await task; 120 | 121 | if (winIndex == 0) return; 122 | throw new ConnectionFailedException(disconnectCause); 123 | } 124 | finally 125 | { 126 | cts.Cancel(); 127 | cts.Dispose(); 128 | } 129 | } 130 | 131 | /// 132 | /// PhotonNetwork.ConnectToBestCloudServer 133 | /// 134 | /// 135 | /// Throws when PhotonNetwork.ConnectToBestCloudServer returns false. 136 | /// Throw when connection to server fails. 137 | public static async UniTask ConnectToBestCloudServerAsync(CancellationToken token = default) 138 | { 139 | var cts = CancellationTokenSource.CreateLinkedTokenSource(token); 140 | try 141 | { 142 | var task = UniTask.WhenAny( 143 | Pun2TaskCallback.OnConnectedToMasterAsync(cts.Token).AsAsyncUnitUniTask(), 144 | Pun2TaskCallback.OnDisconnectedAsync(cts.Token)); 145 | 146 | var result = PhotonNetwork.ConnectToBestCloudServer(); 147 | if (!result) 148 | { 149 | throw new InvalidNetworkOperationException(nameof(ConnectToBestCloudServerAsync) + 150 | " is not ready to connect."); 151 | } 152 | 153 | var (winIndex, _, disconnectCause) = await task; 154 | 155 | if (winIndex == 0) return; 156 | throw new ConnectionFailedException(disconnectCause); 157 | } 158 | finally 159 | { 160 | cts.Cancel(); 161 | cts.Dispose(); 162 | } 163 | } 164 | 165 | /// 166 | /// PhotonNetwork.ConnectToRegion 167 | /// 168 | /// 169 | /// 170 | /// Throws when PhotonNetwork.ConnectToRegion returns false. 171 | /// Throw when connection to server fails. 172 | public static async UniTask ConnectToRegionAsync(string region, CancellationToken token = default) 173 | { 174 | var cts = CancellationTokenSource.CreateLinkedTokenSource(token); 175 | try 176 | { 177 | var task = UniTask.WhenAny( 178 | Pun2TaskCallback.OnConnectedToMasterAsync(cts.Token).AsAsyncUnitUniTask(), 179 | Pun2TaskCallback.OnDisconnectedAsync(cts.Token)); 180 | 181 | var result = PhotonNetwork.ConnectToRegion(region); 182 | if (!result) 183 | { 184 | throw new InvalidNetworkOperationException(nameof(ConnectToRegionAsync) + 185 | " is not ready to connect."); 186 | } 187 | 188 | var (winIndex, _, disconnectCause) = await task; 189 | 190 | if (winIndex == 0) return; 191 | throw new ConnectionFailedException(disconnectCause); 192 | } 193 | finally 194 | { 195 | cts.Cancel(); 196 | cts.Dispose(); 197 | } 198 | } 199 | 200 | /// 201 | /// PhotonNetwork.Disconnect 202 | /// 203 | public static async UniTask DisconnectAsync() 204 | { 205 | if (PhotonNetwork.NetworkClientState == ClientState.Disconnected) return; 206 | PhotonNetwork.Disconnect(); 207 | await Pun2TaskCallback.OnDisconnectedAsync(); 208 | } 209 | 210 | /// 211 | /// PhotonNetwork.Reconnect 212 | /// 213 | /// 214 | /// Throws when PhotonNetwork.Reconnect returns false. 215 | /// Throw when connection to server fails. 216 | public static async UniTask ReconnectAsync(CancellationToken token = default) 217 | { 218 | var cts = CancellationTokenSource.CreateLinkedTokenSource(token); 219 | try 220 | { 221 | var task = UniTask.WhenAny( 222 | Pun2TaskCallback.OnConnectedToMasterAsync(cts.Token).AsAsyncUnitUniTask(), 223 | Pun2TaskCallback.OnDisconnectedAsync(cts.Token)); 224 | 225 | var result = PhotonNetwork.Reconnect(); 226 | if (!result) throw new InvalidNetworkOperationException("It is not ready to reconnect."); 227 | 228 | var (winIndex, _, disconnectCause) = await task; 229 | 230 | if (winIndex == 0) return; 231 | throw new ConnectionFailedException(disconnectCause); 232 | } 233 | finally 234 | { 235 | cts.Cancel(); 236 | cts.Dispose(); 237 | } 238 | } 239 | 240 | #endregion 241 | 242 | #region RoomConnection 243 | 244 | /// 245 | /// PhotonNetwork.CreateRoom 246 | /// 247 | /// 248 | /// 249 | /// 250 | /// 251 | /// 252 | /// Throws when PhotonNetwork.CreateRoom returns false. 253 | /// Throw when room creation fails. 254 | public static async UniTask CreateRoomAsync( 255 | string roomName, 256 | RoomOptions roomOptions = null, 257 | TypedLobby typedLobby = null, 258 | string[] expectedUsers = null, 259 | CancellationToken token = default) 260 | { 261 | var cts = CancellationTokenSource.CreateLinkedTokenSource(token); 262 | try 263 | { 264 | var task = UniTask.WhenAny( 265 | Pun2TaskCallback.OnJoinedRoomAsync(cts.Token).AsAsyncUnitUniTask(), 266 | Pun2TaskCallback.OnCreateRoomFailedAsync(cts.Token)); 267 | 268 | var valid = PhotonNetwork.CreateRoom(roomName, roomOptions, typedLobby, expectedUsers); 269 | if (!valid) throw new InvalidRoomOperationException("It is not ready to create a room."); 270 | 271 | var (winIndex, _, (returnCode, message)) = await task; 272 | if (winIndex == 0) return; 273 | throw new FailedToCreateRoomException(returnCode, message); 274 | } 275 | finally 276 | { 277 | cts.Cancel(); 278 | cts.Dispose(); 279 | } 280 | } 281 | 282 | 283 | /// 284 | /// PhotonNetwork.JoinOrCreateRoom 285 | /// 286 | /// 287 | /// 288 | /// 289 | /// 290 | /// 291 | /// 292 | /// Throws when PhotonNetwork.JoinOrCreateRoom returns false. 293 | /// Throw when room creation fails. 294 | /// Throw when you fail to join the room. 295 | public static async UniTask JoinOrCreateRoomAsync( 296 | string roomName, 297 | RoomOptions roomOptions, 298 | TypedLobby typedLobby, 299 | string[] expectedUsers = null, 300 | CancellationToken token = default) 301 | { 302 | var cts = CancellationTokenSource.CreateLinkedTokenSource(token); 303 | try 304 | { 305 | var createdRoomTask = Pun2TaskCallback.OnCreatedRoomAsync(token).GetAwaiter(); 306 | var task = UniTask.WhenAny( 307 | Pun2TaskCallback.OnJoinedRoomAsync(cts.Token).AsAsyncUnitUniTask(), 308 | Pun2TaskCallback.OnCreateRoomFailedAsync(cts.Token), 309 | Pun2TaskCallback.OnJoinRoomFailedAsync(cts.Token)); 310 | 311 | var valid = PhotonNetwork.JoinOrCreateRoom(roomName, roomOptions, typedLobby, expectedUsers); 312 | if (!valid) throw new InvalidRoomOperationException("It is not ready to join a room."); 313 | 314 | var (winIndex, 315 | _, 316 | (createFailedCode, createFailedMessage), 317 | _) = await task; 318 | return winIndex switch 319 | { 320 | 0 => createdRoomTask.IsCompleted, 321 | 1 => throw new FailedToCreateRoomException(createFailedCode, createFailedMessage), 322 | _ => throw new FailedToJoinRoomException(createFailedCode, createFailedMessage) 323 | }; 324 | } 325 | finally 326 | { 327 | cts.Cancel(); 328 | cts.Dispose(); 329 | } 330 | } 331 | 332 | /// 333 | /// PhotonNetwork.JoinRoom 334 | /// 335 | /// 336 | /// 337 | /// 338 | /// Throws when PhotonNetwork.JoinRoom returns false. 339 | /// Throw when you fail to join the room. 340 | public static async UniTask JoinRoomAsync(string roomName, 341 | string[] expectedUsers = null, 342 | CancellationToken token = default) 343 | { 344 | var cts = CancellationTokenSource.CreateLinkedTokenSource(token); 345 | try 346 | { 347 | var task = UniTask.WhenAny( 348 | Pun2TaskCallback.OnJoinedRoomAsync(cts.Token).AsAsyncUnitUniTask(), 349 | Pun2TaskCallback.OnJoinRoomFailedAsync(cts.Token)); 350 | 351 | var valid = PhotonNetwork.JoinRoom(roomName, expectedUsers); 352 | if (!valid) throw new InvalidRoomOperationException("It is not ready to join a room."); 353 | 354 | var (winIndex, _, (returnCode, message)) = await task; 355 | if (winIndex == 0) return; 356 | throw new FailedToJoinRoomException(returnCode, message); 357 | } 358 | finally 359 | { 360 | cts.Cancel(); 361 | cts.Dispose(); 362 | } 363 | } 364 | 365 | /// 366 | /// PhotonNetwork.JoinRandomRoom 367 | /// 368 | /// 369 | /// 370 | /// 371 | /// 372 | /// 373 | /// 374 | /// 375 | /// Throws when PhotonNetwork.JoinRandomRoom returns false. 376 | /// Throw when you fail to join the room. 377 | public static async UniTask JoinRandomRoomAsync( 378 | Hashtable expectedCustomRoomProperties, 379 | byte expectedMaxPlayers, 380 | MatchmakingMode matchingType, 381 | TypedLobby typedLobby, 382 | string sqlLobbyFilter, 383 | string[] expectedUsers = null, 384 | CancellationToken token = default) 385 | { 386 | var cts = CancellationTokenSource.CreateLinkedTokenSource(token); 387 | try 388 | { 389 | var task = UniTask.WhenAny( 390 | Pun2TaskCallback.OnJoinedRoomAsync(cts.Token).AsAsyncUnitUniTask(), 391 | Pun2TaskCallback.OnJoinRandomFailedAsync(cts.Token)); 392 | 393 | var valid = PhotonNetwork.JoinRandomRoom( 394 | expectedCustomRoomProperties, 395 | expectedMaxPlayers, 396 | matchingType, 397 | typedLobby, 398 | sqlLobbyFilter, 399 | expectedUsers); 400 | if (!valid) throw new InvalidRoomOperationException("It is not ready to join a room."); 401 | 402 | var (winIndex, _, (returnCode, message)) = await task; 403 | if (winIndex == 0) return; 404 | throw new FailedToJoinRoomException(returnCode, message); 405 | } 406 | finally 407 | { 408 | cts.Cancel(); 409 | cts.Dispose(); 410 | } 411 | } 412 | 413 | /// 414 | /// PhotonNetwork.RejoinRoom 415 | /// 416 | /// 417 | /// 418 | /// Throws when PhotonNetwork.RejoinRoom returns false. 419 | /// Throw when you fail to join the room. 420 | public static async UniTask RejoinRoomAsync(string roomName, CancellationToken token = default) 421 | { 422 | var cts = CancellationTokenSource.CreateLinkedTokenSource(token); 423 | try 424 | { 425 | var task = UniTask.WhenAny( 426 | Pun2TaskCallback.OnJoinedRoomAsync(cts.Token).AsAsyncUnitUniTask(), 427 | Pun2TaskCallback.OnJoinRoomFailedAsync(cts.Token)); 428 | 429 | var valid = PhotonNetwork.RejoinRoom(roomName); 430 | if (!valid) throw new InvalidRoomOperationException("It is not ready to join a room."); 431 | 432 | var (winIndex, _, (returnCode, message)) = await task; 433 | if (winIndex == 0) return; 434 | throw new FailedToJoinRoomException(returnCode, message); 435 | } 436 | finally 437 | { 438 | cts.Cancel(); 439 | cts.Dispose(); 440 | } 441 | } 442 | 443 | /// 444 | /// PhotonNetwork.ReconnectAndRejoin 445 | /// 446 | /// 447 | /// Throws when PhotonNetwork.ReconnectAndRejoin returns false. 448 | /// Throw when you fail to join the room. 449 | public static async UniTask ReconnectAndRejoinAsync(CancellationToken token) 450 | { 451 | var cts = CancellationTokenSource.CreateLinkedTokenSource(token); 452 | try 453 | { 454 | var task = UniTask.WhenAny( 455 | Pun2TaskCallback.OnJoinedRoomAsync(cts.Token).AsAsyncUnitUniTask(), 456 | Pun2TaskCallback.OnJoinRoomFailedAsync(cts.Token)); 457 | 458 | var valid = PhotonNetwork.ReconnectAndRejoin(); 459 | if (!valid) throw new InvalidRoomOperationException("It is not ready to join a room."); 460 | 461 | var (winIndex, _, (returnCode, message)) = await task; 462 | if (winIndex == 0) return; 463 | throw new FailedToJoinRoomException(returnCode, message); 464 | } 465 | finally 466 | { 467 | cts.Cancel(); 468 | cts.Dispose(); 469 | } 470 | } 471 | 472 | /// 473 | /// PhotonNetwork.LeaveRoom 474 | /// 475 | /// 476 | /// Throws when PhotonNetwork.LeaveRoom returns false. 477 | public static async UniTask LeaveRoomAsync(bool becomeInactive = true, CancellationToken token = default) 478 | { 479 | if (!PhotonNetwork.LeaveRoom(becomeInactive)) 480 | { 481 | throw new InvalidRoomOperationException("Failed to leave room."); 482 | } 483 | 484 | await Pun2TaskCallback.OnLeftRoomAsync(token); 485 | } 486 | 487 | /// 488 | /// PhotonNetwork.JoinLobby 489 | /// 490 | /// 491 | /// 492 | /// Throws when PhotonNetwork.JoinLobbyAsync returns false. 493 | public static async UniTask JoinLobbyAsync(TypedLobby typedLobby = null, 494 | CancellationToken token = default) 495 | { 496 | if (!PhotonNetwork.JoinLobby(typedLobby)) 497 | { 498 | throw new InvalidNetworkOperationException("Failed to join lobby."); 499 | } 500 | 501 | await Pun2TaskCallback.OnJoinedLobbyAsync(token); 502 | } 503 | 504 | /// 505 | /// PhotonNetwork.LeaveLobby 506 | /// 507 | /// 508 | /// Throws when PhotonNetwork.OnLeftLobbyAsync returns false. 509 | public static async UniTask LeaveLobbyAsync(CancellationToken token = default) 510 | { 511 | if (!PhotonNetwork.LeaveLobby()) 512 | { 513 | throw new InvalidNetworkOperationException("Failed to leave lobby."); 514 | } 515 | 516 | await Pun2TaskCallback.OnLeftLobbyAsync(token); 517 | } 518 | 519 | #endregion 520 | 521 | /// 522 | /// PhotonNetwork.GetCustomRoomList 523 | /// 524 | /// 525 | /// 526 | /// 527 | /// 528 | /// Throws when PhotonNetwork.GetCustomRoomList returns false. 529 | public static async UniTask> GetCustomRoomListAsync(TypedLobby typedLobby, 530 | string sqlLobbyFilter, 531 | CancellationToken token = default) 532 | { 533 | if (!PhotonNetwork.GetCustomRoomList(typedLobby, sqlLobbyFilter)) 534 | { 535 | throw new InvalidNetworkOperationException("Failed to get custom room list."); 536 | } 537 | 538 | return await Pun2TaskCallback.OnRoomListUpdateAsync(token); 539 | } 540 | 541 | 542 | #region Exceptions 543 | 544 | public class ConnectionFailedException : Pun2TaskException 545 | { 546 | public DisconnectCause DisconnectCause { get; } 547 | 548 | public ConnectionFailedException(DisconnectCause disconnectCause) 549 | { 550 | DisconnectCause = disconnectCause; 551 | } 552 | } 553 | 554 | public class InvalidNetworkOperationException : Pun2TaskException 555 | { 556 | public InvalidNetworkOperationException(string message) : base(message) 557 | { 558 | } 559 | } 560 | 561 | public class InvalidRoomOperationException : InvalidNetworkOperationException 562 | { 563 | public InvalidRoomOperationException(string message) : base(message) 564 | { 565 | } 566 | } 567 | 568 | public class FailedToJoinRoomException : Pun2TaskException 569 | { 570 | public short ReturnCode { get; } 571 | 572 | public FailedToJoinRoomException(short returnCode, string message) : base(message) 573 | { 574 | ReturnCode = returnCode; 575 | } 576 | } 577 | 578 | public class FailedToJoinLobbyException : Pun2TaskException 579 | { 580 | public short ReturnCode { get; } 581 | 582 | public FailedToJoinLobbyException(short returnCode, string message) : base(message) 583 | { 584 | ReturnCode = returnCode; 585 | } 586 | } 587 | 588 | public class FailedToCreateRoomException : Pun2TaskException 589 | { 590 | public short ReturnCode { get; } 591 | 592 | public FailedToCreateRoomException(short returnCode, string message) : base(message) 593 | { 594 | ReturnCode = returnCode; 595 | } 596 | } 597 | 598 | public class Pun2TaskException : Exception 599 | { 600 | public Pun2TaskException() 601 | { 602 | } 603 | 604 | public Pun2TaskException(string message) : base(message) 605 | { 606 | } 607 | } 608 | 609 | #endregion 610 | } 611 | } 612 | #endif -------------------------------------------------------------------------------- /Assets/Plugins/Pun2Task/Pun2TaskNetwork.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c35f12a60cd425caeeb1916af69e174 3 | timeCreated: 1604389172 -------------------------------------------------------------------------------- /Assets/Plugins/Pun2Task/PunViewCallback.cs: -------------------------------------------------------------------------------- 1 | #if PUN_TO_UNITASK_SUPPORT 2 | 3 | using System.Threading; 4 | using Cysharp.Threading.Tasks; 5 | using Cysharp.Threading.Tasks.Linq; 6 | using Photon.Pun; 7 | using Photon.Realtime; 8 | using UnityEngine; 9 | 10 | namespace Pun2Task 11 | { 12 | public sealed class PunViewCallback : MonoBehaviour, IPunOwnershipCallbacks 13 | { 14 | private readonly AsyncReactiveProperty<(PhotonView targetView, Player requestingPlayer)> _ownershipRequestAsync 15 | = new AsyncReactiveProperty<(PhotonView targetView, Player requestingPlayer)>(default); 16 | 17 | private readonly AsyncReactiveProperty<(PhotonView targetView, Player previousOwner)> _ownershipTransferedAsync 18 | = new AsyncReactiveProperty<(PhotonView targetView, Player previousOwner)>(default); 19 | 20 | private readonly AsyncReactiveProperty<(PhotonView targetView, Player senderOfFailedRequest)> _ownershipTransferFailedAsync 21 | = new AsyncReactiveProperty<(PhotonView targetView, Player senderOfFailedRequest)>(default); 22 | 23 | private readonly AsyncReactiveProperty _isMine = new AsyncReactiveProperty(false); 24 | 25 | public IUniTaskAsyncEnumerable<(PhotonView targetView, Player requestingPlayer)> OwnershipRequestAsyncEnumerable 26 | => _ownershipRequestAsync; 27 | 28 | public IUniTaskAsyncEnumerable<(PhotonView targetView, Player previousOwner)> OwnershipTransferedAsyncEnumerable 29 | => _ownershipTransferedAsync; 30 | 31 | public IUniTaskAsyncEnumerable<(PhotonView targetView, Player previousOwner)> OwnershipTransferFailedAsyncEnumerable 32 | => _ownershipTransferFailedAsync; 33 | 34 | public IUniTaskAsyncEnumerable IsMineAsyncEnumerable => _isMine; 35 | 36 | private PhotonView _myView; 37 | 38 | public void Setup(PhotonView view) 39 | { 40 | _myView = view; 41 | _isMine.Value = view.IsMine; 42 | } 43 | 44 | private void OnEnable() 45 | { 46 | PhotonNetwork.AddCallbackTarget(this); 47 | } 48 | 49 | private void OnDisable() 50 | { 51 | PhotonNetwork.RemoveCallbackTarget(this); 52 | } 53 | 54 | private void OnDestroy() 55 | { 56 | _ownershipRequestAsync.Dispose(); 57 | _ownershipTransferedAsync.Dispose(); 58 | _ownershipTransferFailedAsync.Dispose(); 59 | _isMine.Dispose(); 60 | } 61 | 62 | public void OnOwnershipRequest(PhotonView targetView, Player requestingPlayer) 63 | { 64 | _ownershipRequestAsync.Value = (targetView, requestingPlayer); 65 | } 66 | 67 | public void OnOwnershipTransfered(PhotonView targetView, Player previousOwner) 68 | { 69 | _ownershipTransferedAsync.Value = (targetView, previousOwner); 70 | if (_isMine.Value != _myView.IsMine) 71 | { 72 | _isMine.Value = _myView.IsMine; 73 | } 74 | } 75 | 76 | public void OnOwnershipTransferFailed(PhotonView targetView, Player senderOfFailedRequest) 77 | { 78 | _ownershipTransferFailedAsync.Value = (targetView, senderOfFailedRequest); 79 | } 80 | } 81 | 82 | public static class PhotonViewExt 83 | { 84 | /// 85 | /// OnOwnershipRequest 86 | /// 87 | public static IUniTaskAsyncEnumerable<(PhotonView targetView, Player requestingPlayer)> 88 | OwnershipRequestAsyncEnumerable(this PhotonView view) 89 | { 90 | return GetOrAdd(view).OwnershipRequestAsyncEnumerable; 91 | } 92 | 93 | /// 94 | /// OnOwnershipTransfered 95 | /// 96 | public static IUniTaskAsyncEnumerable<(PhotonView targetView, Player previousOwner)> 97 | OwnershipTransferedAsyncEnumerable(this PhotonView view) 98 | { 99 | return GetOrAdd(view).OwnershipTransferedAsyncEnumerable; 100 | } 101 | 102 | /// 103 | /// OnOwnershipTransferFailed 104 | /// 105 | public static IUniTaskAsyncEnumerable<(PhotonView targetView, Player previousOwner)> 106 | OwnershipTransferFailedAsyncEnumerable(this PhotonView view) 107 | { 108 | return GetOrAdd(view).OwnershipTransferFailedAsyncEnumerable; 109 | } 110 | 111 | /// 112 | /// PhotonView.IsMine 113 | /// 114 | public static IUniTaskAsyncEnumerable IsMineAsyncEnumerable(this PhotonView view) 115 | { 116 | return GetOrAdd(view).IsMineAsyncEnumerable; 117 | } 118 | 119 | /// 120 | /// After call PhotonView.RequestOwnership, wait until take ownership. 121 | /// 122 | public static async UniTask RequestOwnershipAsync(this PhotonView view, CancellationToken token = default) 123 | { 124 | if (view.IsMine) return; 125 | view.RequestOwnership(); 126 | await view.IsMineAsyncEnumerable().FirstOrDefaultAsync(x => x, token); 127 | } 128 | 129 | private static PunViewCallback GetOrAdd(PhotonView view) 130 | { 131 | if (view.TryGetComponent(out var c)) 132 | { 133 | return c; 134 | } 135 | 136 | var p = view.gameObject.AddComponent(); 137 | p.Setup(view); 138 | return p; 139 | } 140 | } 141 | } 142 | 143 | #endif -------------------------------------------------------------------------------- /Assets/Plugins/Pun2Task/PunViewCallback.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2ff812e87c234558945f74af2d63b79d 3 | timeCreated: 1604501698 -------------------------------------------------------------------------------- /Assets/Plugins/Pun2Task/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.torisoup.pun2task", 3 | "displayName": "Pun2Task", 4 | "version": "1.1.1", 5 | "unity": "2022.3", 6 | "description": "Provides async/await support for PUN2 ", 7 | "license": "MIT", 8 | "dependencies": { 9 | "com.cysharp.unitask": "2.5.5" 10 | } 11 | } -------------------------------------------------------------------------------- /Assets/Plugins/Pun2Task/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69e65021438dd8d4b85bceadfc1cdfcb 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2020 TORISOUP 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.cysharp.unitask": "2.5.5", 4 | "com.unity.ai.navigation": "1.1.5", 5 | "com.unity.collab-proxy": "2.3.1", 6 | "com.unity.ide.rider": "3.0.28", 7 | "com.unity.ide.visualstudio": "2.0.22", 8 | "com.unity.ide.vscode": "1.2.5", 9 | "com.unity.test-framework": "1.1.33", 10 | "com.unity.textmeshpro": "3.0.6", 11 | "com.unity.timeline": "1.7.6", 12 | "com.unity.ugui": "1.0.0", 13 | "com.unity.modules.ai": "1.0.0", 14 | "com.unity.modules.androidjni": "1.0.0", 15 | "com.unity.modules.animation": "1.0.0", 16 | "com.unity.modules.assetbundle": "1.0.0", 17 | "com.unity.modules.audio": "1.0.0", 18 | "com.unity.modules.cloth": "1.0.0", 19 | "com.unity.modules.director": "1.0.0", 20 | "com.unity.modules.imageconversion": "1.0.0", 21 | "com.unity.modules.imgui": "1.0.0", 22 | "com.unity.modules.jsonserialize": "1.0.0", 23 | "com.unity.modules.particlesystem": "1.0.0", 24 | "com.unity.modules.physics": "1.0.0", 25 | "com.unity.modules.physics2d": "1.0.0", 26 | "com.unity.modules.screencapture": "1.0.0", 27 | "com.unity.modules.terrain": "1.0.0", 28 | "com.unity.modules.terrainphysics": "1.0.0", 29 | "com.unity.modules.tilemap": "1.0.0", 30 | "com.unity.modules.ui": "1.0.0", 31 | "com.unity.modules.uielements": "1.0.0", 32 | "com.unity.modules.umbra": "1.0.0", 33 | "com.unity.modules.unityanalytics": "1.0.0", 34 | "com.unity.modules.unitywebrequest": "1.0.0", 35 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 36 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 37 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 38 | "com.unity.modules.unitywebrequestwww": "1.0.0", 39 | "com.unity.modules.vehicles": "1.0.0", 40 | "com.unity.modules.video": "1.0.0", 41 | "com.unity.modules.vr": "1.0.0", 42 | "com.unity.modules.wind": "1.0.0", 43 | "com.unity.modules.xr": "1.0.0" 44 | }, 45 | "scopedRegistries": [ 46 | { 47 | "name": "package.openupm.com", 48 | "url": "https://package.openupm.com", 49 | "scopes": [ 50 | "com.cysharp.unitask", 51 | "com.openupm" 52 | ] 53 | } 54 | ] 55 | } 56 | -------------------------------------------------------------------------------- /Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.cysharp.unitask": { 4 | "version": "2.5.5", 5 | "depth": 0, 6 | "source": "registry", 7 | "dependencies": {}, 8 | "url": "https://package.openupm.com" 9 | }, 10 | "com.unity.ai.navigation": { 11 | "version": "1.1.5", 12 | "depth": 0, 13 | "source": "registry", 14 | "dependencies": { 15 | "com.unity.modules.ai": "1.0.0" 16 | }, 17 | "url": "https://packages.unity.com" 18 | }, 19 | "com.unity.collab-proxy": { 20 | "version": "2.3.1", 21 | "depth": 0, 22 | "source": "registry", 23 | "dependencies": {}, 24 | "url": "https://packages.unity.com" 25 | }, 26 | "com.unity.ext.nunit": { 27 | "version": "1.0.6", 28 | "depth": 1, 29 | "source": "registry", 30 | "dependencies": {}, 31 | "url": "https://packages.unity.com" 32 | }, 33 | "com.unity.ide.rider": { 34 | "version": "3.0.28", 35 | "depth": 0, 36 | "source": "registry", 37 | "dependencies": { 38 | "com.unity.ext.nunit": "1.0.6" 39 | }, 40 | "url": "https://packages.unity.com" 41 | }, 42 | "com.unity.ide.visualstudio": { 43 | "version": "2.0.22", 44 | "depth": 0, 45 | "source": "registry", 46 | "dependencies": { 47 | "com.unity.test-framework": "1.1.9" 48 | }, 49 | "url": "https://packages.unity.com" 50 | }, 51 | "com.unity.ide.vscode": { 52 | "version": "1.2.5", 53 | "depth": 0, 54 | "source": "registry", 55 | "dependencies": {}, 56 | "url": "https://packages.unity.com" 57 | }, 58 | "com.unity.test-framework": { 59 | "version": "1.1.33", 60 | "depth": 0, 61 | "source": "registry", 62 | "dependencies": { 63 | "com.unity.ext.nunit": "1.0.6", 64 | "com.unity.modules.imgui": "1.0.0", 65 | "com.unity.modules.jsonserialize": "1.0.0" 66 | }, 67 | "url": "https://packages.unity.com" 68 | }, 69 | "com.unity.textmeshpro": { 70 | "version": "3.0.6", 71 | "depth": 0, 72 | "source": "registry", 73 | "dependencies": { 74 | "com.unity.ugui": "1.0.0" 75 | }, 76 | "url": "https://packages.unity.com" 77 | }, 78 | "com.unity.timeline": { 79 | "version": "1.7.6", 80 | "depth": 0, 81 | "source": "registry", 82 | "dependencies": { 83 | "com.unity.modules.audio": "1.0.0", 84 | "com.unity.modules.director": "1.0.0", 85 | "com.unity.modules.animation": "1.0.0", 86 | "com.unity.modules.particlesystem": "1.0.0" 87 | }, 88 | "url": "https://packages.unity.com" 89 | }, 90 | "com.unity.ugui": { 91 | "version": "1.0.0", 92 | "depth": 0, 93 | "source": "builtin", 94 | "dependencies": { 95 | "com.unity.modules.ui": "1.0.0", 96 | "com.unity.modules.imgui": "1.0.0" 97 | } 98 | }, 99 | "com.unity.modules.ai": { 100 | "version": "1.0.0", 101 | "depth": 0, 102 | "source": "builtin", 103 | "dependencies": {} 104 | }, 105 | "com.unity.modules.androidjni": { 106 | "version": "1.0.0", 107 | "depth": 0, 108 | "source": "builtin", 109 | "dependencies": {} 110 | }, 111 | "com.unity.modules.animation": { 112 | "version": "1.0.0", 113 | "depth": 0, 114 | "source": "builtin", 115 | "dependencies": {} 116 | }, 117 | "com.unity.modules.assetbundle": { 118 | "version": "1.0.0", 119 | "depth": 0, 120 | "source": "builtin", 121 | "dependencies": {} 122 | }, 123 | "com.unity.modules.audio": { 124 | "version": "1.0.0", 125 | "depth": 0, 126 | "source": "builtin", 127 | "dependencies": {} 128 | }, 129 | "com.unity.modules.cloth": { 130 | "version": "1.0.0", 131 | "depth": 0, 132 | "source": "builtin", 133 | "dependencies": { 134 | "com.unity.modules.physics": "1.0.0" 135 | } 136 | }, 137 | "com.unity.modules.director": { 138 | "version": "1.0.0", 139 | "depth": 0, 140 | "source": "builtin", 141 | "dependencies": { 142 | "com.unity.modules.audio": "1.0.0", 143 | "com.unity.modules.animation": "1.0.0" 144 | } 145 | }, 146 | "com.unity.modules.imageconversion": { 147 | "version": "1.0.0", 148 | "depth": 0, 149 | "source": "builtin", 150 | "dependencies": {} 151 | }, 152 | "com.unity.modules.imgui": { 153 | "version": "1.0.0", 154 | "depth": 0, 155 | "source": "builtin", 156 | "dependencies": {} 157 | }, 158 | "com.unity.modules.jsonserialize": { 159 | "version": "1.0.0", 160 | "depth": 0, 161 | "source": "builtin", 162 | "dependencies": {} 163 | }, 164 | "com.unity.modules.particlesystem": { 165 | "version": "1.0.0", 166 | "depth": 0, 167 | "source": "builtin", 168 | "dependencies": {} 169 | }, 170 | "com.unity.modules.physics": { 171 | "version": "1.0.0", 172 | "depth": 0, 173 | "source": "builtin", 174 | "dependencies": {} 175 | }, 176 | "com.unity.modules.physics2d": { 177 | "version": "1.0.0", 178 | "depth": 0, 179 | "source": "builtin", 180 | "dependencies": {} 181 | }, 182 | "com.unity.modules.screencapture": { 183 | "version": "1.0.0", 184 | "depth": 0, 185 | "source": "builtin", 186 | "dependencies": { 187 | "com.unity.modules.imageconversion": "1.0.0" 188 | } 189 | }, 190 | "com.unity.modules.subsystems": { 191 | "version": "1.0.0", 192 | "depth": 1, 193 | "source": "builtin", 194 | "dependencies": { 195 | "com.unity.modules.jsonserialize": "1.0.0" 196 | } 197 | }, 198 | "com.unity.modules.terrain": { 199 | "version": "1.0.0", 200 | "depth": 0, 201 | "source": "builtin", 202 | "dependencies": {} 203 | }, 204 | "com.unity.modules.terrainphysics": { 205 | "version": "1.0.0", 206 | "depth": 0, 207 | "source": "builtin", 208 | "dependencies": { 209 | "com.unity.modules.physics": "1.0.0", 210 | "com.unity.modules.terrain": "1.0.0" 211 | } 212 | }, 213 | "com.unity.modules.tilemap": { 214 | "version": "1.0.0", 215 | "depth": 0, 216 | "source": "builtin", 217 | "dependencies": { 218 | "com.unity.modules.physics2d": "1.0.0" 219 | } 220 | }, 221 | "com.unity.modules.ui": { 222 | "version": "1.0.0", 223 | "depth": 0, 224 | "source": "builtin", 225 | "dependencies": {} 226 | }, 227 | "com.unity.modules.uielements": { 228 | "version": "1.0.0", 229 | "depth": 0, 230 | "source": "builtin", 231 | "dependencies": { 232 | "com.unity.modules.ui": "1.0.0", 233 | "com.unity.modules.imgui": "1.0.0", 234 | "com.unity.modules.jsonserialize": "1.0.0" 235 | } 236 | }, 237 | "com.unity.modules.umbra": { 238 | "version": "1.0.0", 239 | "depth": 0, 240 | "source": "builtin", 241 | "dependencies": {} 242 | }, 243 | "com.unity.modules.unityanalytics": { 244 | "version": "1.0.0", 245 | "depth": 0, 246 | "source": "builtin", 247 | "dependencies": { 248 | "com.unity.modules.unitywebrequest": "1.0.0", 249 | "com.unity.modules.jsonserialize": "1.0.0" 250 | } 251 | }, 252 | "com.unity.modules.unitywebrequest": { 253 | "version": "1.0.0", 254 | "depth": 0, 255 | "source": "builtin", 256 | "dependencies": {} 257 | }, 258 | "com.unity.modules.unitywebrequestassetbundle": { 259 | "version": "1.0.0", 260 | "depth": 0, 261 | "source": "builtin", 262 | "dependencies": { 263 | "com.unity.modules.assetbundle": "1.0.0", 264 | "com.unity.modules.unitywebrequest": "1.0.0" 265 | } 266 | }, 267 | "com.unity.modules.unitywebrequestaudio": { 268 | "version": "1.0.0", 269 | "depth": 0, 270 | "source": "builtin", 271 | "dependencies": { 272 | "com.unity.modules.unitywebrequest": "1.0.0", 273 | "com.unity.modules.audio": "1.0.0" 274 | } 275 | }, 276 | "com.unity.modules.unitywebrequesttexture": { 277 | "version": "1.0.0", 278 | "depth": 0, 279 | "source": "builtin", 280 | "dependencies": { 281 | "com.unity.modules.unitywebrequest": "1.0.0", 282 | "com.unity.modules.imageconversion": "1.0.0" 283 | } 284 | }, 285 | "com.unity.modules.unitywebrequestwww": { 286 | "version": "1.0.0", 287 | "depth": 0, 288 | "source": "builtin", 289 | "dependencies": { 290 | "com.unity.modules.unitywebrequest": "1.0.0", 291 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 292 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 293 | "com.unity.modules.audio": "1.0.0", 294 | "com.unity.modules.assetbundle": "1.0.0", 295 | "com.unity.modules.imageconversion": "1.0.0" 296 | } 297 | }, 298 | "com.unity.modules.vehicles": { 299 | "version": "1.0.0", 300 | "depth": 0, 301 | "source": "builtin", 302 | "dependencies": { 303 | "com.unity.modules.physics": "1.0.0" 304 | } 305 | }, 306 | "com.unity.modules.video": { 307 | "version": "1.0.0", 308 | "depth": 0, 309 | "source": "builtin", 310 | "dependencies": { 311 | "com.unity.modules.audio": "1.0.0", 312 | "com.unity.modules.ui": "1.0.0", 313 | "com.unity.modules.unitywebrequest": "1.0.0" 314 | } 315 | }, 316 | "com.unity.modules.vr": { 317 | "version": "1.0.0", 318 | "depth": 0, 319 | "source": "builtin", 320 | "dependencies": { 321 | "com.unity.modules.jsonserialize": "1.0.0", 322 | "com.unity.modules.physics": "1.0.0", 323 | "com.unity.modules.xr": "1.0.0" 324 | } 325 | }, 326 | "com.unity.modules.wind": { 327 | "version": "1.0.0", 328 | "depth": 0, 329 | "source": "builtin", 330 | "dependencies": {} 331 | }, 332 | "com.unity.modules.xr": { 333 | "version": "1.0.0", 334 | "depth": 0, 335 | "source": "builtin", 336 | "dependencies": { 337 | "com.unity.modules.physics": "1.0.0", 338 | "com.unity.modules.jsonserialize": "1.0.0", 339 | "com.unity.modules.subsystems": "1.0.0" 340 | } 341 | } 342 | } 343 | } 344 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 9 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 0 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 0 30 | m_AssetPipelineMode: 1 31 | m_CacheServerMode: 0 32 | m_CacheServerEndpoint: 33 | m_CacheServerNamespacePrefix: default 34 | m_CacheServerEnableDownload: 1 35 | m_CacheServerEnableUpload: 1 36 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} 40 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 41 | m_PreloadedShaders: [] 42 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 43 | type: 0} 44 | m_CustomRenderPipeline: {fileID: 0} 45 | m_TransparencySortMode: 0 46 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 47 | m_DefaultRenderingPath: 1 48 | m_DefaultMobileRenderingPath: 1 49 | m_TierSettings: [] 50 | m_LightmapStripping: 0 51 | m_FogStripping: 0 52 | m_InstancingStripping: 0 53 | m_LightmapKeepPlain: 1 54 | m_LightmapKeepDirCombined: 1 55 | m_LightmapKeepDynamicPlain: 1 56 | m_LightmapKeepDynamicDirCombined: 1 57 | m_LightmapKeepShadowMask: 1 58 | m_LightmapKeepSubtractive: 1 59 | m_FogKeepLinear: 1 60 | m_FogKeepExp: 1 61 | m_FogKeepExp2: 1 62 | m_AlbedoSwatchInfos: [] 63 | m_LightsUseLinearIntensity: 0 64 | m_LightsUseColorTemperature: 0 65 | m_LogWhenShaderIsCompiled: 0 66 | m_AllowEnlightenSupportForUpgradedProject: 0 67 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 53 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 0 16 | m_AdvancedSettingsExpanded: 1 17 | m_ScopedRegistriesSettingsExpanded: 1 18 | m_SeeAllPackageVersions: 0 19 | m_DismissPreviewPackagesInUse: 0 20 | oneTimeWarningShown: 0 21 | m_Registries: 22 | - m_Id: main 23 | m_Name: 24 | m_Url: https://packages.unity.com 25 | m_Scopes: [] 26 | m_IsDefault: 1 27 | m_Capabilities: 7 28 | m_ConfigSource: 0 29 | - m_Id: scoped:project:package.openupm.com 30 | m_Name: package.openupm.com 31 | m_Url: https://package.openupm.com 32 | m_Scopes: 33 | - com.cysharp.unitask 34 | - com.openupm 35 | m_IsDefault: 0 36 | m_Capabilities: 0 37 | m_ConfigSource: 4 38 | m_UserSelectedRegistryName: 39 | m_UserAddingNewScopedRegistry: 0 40 | m_RegistryInfoDraft: 41 | m_Modified: 0 42 | m_ErrorMessage: 43 | m_UserModificationsInstanceId: -856 44 | m_OriginalInstanceId: -858 45 | m_LoadAssets: 0 46 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 20 7 | productGUID: 9bc8216993f6dab47b8c704a6373071b 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: Pun2Async 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 53 | iosShowActivityIndicatorOnLoading: -1 54 | androidShowActivityIndicatorOnLoading: -1 55 | iosUseCustomAppBackgroundBehavior: 0 56 | iosAllowHTTPDownload: 1 57 | allowedAutorotateToPortrait: 1 58 | allowedAutorotateToPortraitUpsideDown: 1 59 | allowedAutorotateToLandscapeRight: 1 60 | allowedAutorotateToLandscapeLeft: 1 61 | useOSAutorotation: 1 62 | use32BitDisplayBuffer: 1 63 | preserveFramebufferAlpha: 0 64 | disableDepthAndStencilBuffers: 0 65 | androidStartInFullscreen: 1 66 | androidRenderOutsideSafeArea: 1 67 | androidUseSwappy: 0 68 | androidBlitType: 0 69 | defaultIsNativeResolution: 1 70 | macRetinaSupport: 1 71 | runInBackground: 1 72 | captureSingleScreen: 0 73 | muteOtherAudioSources: 0 74 | Prepare IOS For Recording: 0 75 | Force IOS Speakers When Recording: 0 76 | deferSystemGesturesMode: 0 77 | hideHomeButton: 0 78 | submitAnalytics: 1 79 | usePlayerLog: 1 80 | bakeCollisionMeshes: 0 81 | forceSingleInstance: 0 82 | useFlipModelSwapchain: 1 83 | resizableWindow: 0 84 | useMacAppStoreValidation: 0 85 | macAppStoreCategory: public.app-category.games 86 | gpuSkinning: 1 87 | xboxPIXTextureCapture: 0 88 | xboxEnableAvatar: 0 89 | xboxEnableKinect: 0 90 | xboxEnableKinectAutoTracking: 0 91 | xboxEnableFitness: 0 92 | visibleInBackground: 1 93 | allowFullscreenSwitch: 1 94 | fullscreenMode: 1 95 | xboxSpeechDB: 0 96 | xboxEnableHeadOrientation: 0 97 | xboxEnableGuest: 0 98 | xboxEnablePIXSampling: 0 99 | metalFramebufferOnly: 0 100 | xboxOneResolution: 0 101 | xboxOneSResolution: 0 102 | xboxOneXResolution: 3 103 | xboxOneMonoLoggingLevel: 0 104 | xboxOneLoggingLevel: 1 105 | xboxOneDisableEsram: 0 106 | xboxOneEnableTypeOptimization: 0 107 | xboxOnePresentImmediateThreshold: 0 108 | switchQueueCommandMemory: 0 109 | switchQueueControlMemory: 16384 110 | switchQueueComputeMemory: 262144 111 | switchNVNShaderPoolsGranularity: 33554432 112 | switchNVNDefaultPoolsGranularity: 16777216 113 | switchNVNOtherPoolsGranularity: 16777216 114 | stadiaPresentMode: 0 115 | stadiaTargetFramerate: 0 116 | vulkanNumSwapchainBuffers: 3 117 | vulkanEnableSetSRGBWrite: 0 118 | m_SupportedAspectRatios: 119 | 4:3: 1 120 | 5:4: 1 121 | 16:10: 1 122 | 16:9: 1 123 | Others: 1 124 | bundleVersion: 0.1 125 | preloadedAssets: [] 126 | metroInputSource: 0 127 | wsaTransparentSwapchain: 0 128 | m_HolographicPauseOnTrackingLoss: 1 129 | xboxOneDisableKinectGpuReservation: 1 130 | xboxOneEnable7thCore: 1 131 | vrSettings: 132 | cardboard: 133 | depthFormat: 0 134 | enableTransitionView: 0 135 | daydream: 136 | depthFormat: 0 137 | useSustainedPerformanceMode: 0 138 | enableVideoLayer: 0 139 | useProtectedVideoMemory: 0 140 | minimumSupportedHeadTracking: 0 141 | maximumSupportedHeadTracking: 1 142 | hololens: 143 | depthFormat: 1 144 | depthBufferSharingEnabled: 1 145 | lumin: 146 | depthFormat: 0 147 | frameTiming: 2 148 | enableGLCache: 0 149 | glCacheMaxBlobSize: 524288 150 | glCacheMaxFileSize: 8388608 151 | oculus: 152 | sharedDepthBuffer: 1 153 | dashSupport: 1 154 | lowOverheadMode: 0 155 | protectedContext: 0 156 | v2Signing: 1 157 | enable360StereoCapture: 0 158 | isWsaHolographicRemotingEnabled: 0 159 | enableFrameTimingStats: 0 160 | useHDRDisplay: 0 161 | D3DHDRBitDepth: 0 162 | m_ColorGamuts: 00000000 163 | targetPixelDensity: 30 164 | resolutionScalingMode: 0 165 | androidSupportedAspectRatio: 1 166 | androidMaxAspectRatio: 2.1 167 | applicationIdentifier: {} 168 | buildNumber: {} 169 | AndroidBundleVersionCode: 1 170 | AndroidMinSdkVersion: 19 171 | AndroidTargetSdkVersion: 0 172 | AndroidPreferredInstallLocation: 1 173 | aotOptions: 174 | stripEngineCode: 1 175 | iPhoneStrippingLevel: 0 176 | iPhoneScriptCallOptimization: 0 177 | ForceInternetPermission: 0 178 | ForceSDCardPermission: 0 179 | CreateWallpaper: 0 180 | APKExpansionFiles: 0 181 | keepLoadedShadersAlive: 0 182 | StripUnusedMeshComponents: 1 183 | VertexChannelCompressionMask: 4054 184 | iPhoneSdkVersion: 988 185 | iOSTargetOSVersionString: 10.0 186 | tvOSSdkVersion: 0 187 | tvOSRequireExtendedGameController: 0 188 | tvOSTargetOSVersionString: 10.0 189 | uIPrerenderedIcon: 0 190 | uIRequiresPersistentWiFi: 0 191 | uIRequiresFullScreen: 1 192 | uIStatusBarHidden: 1 193 | uIExitOnSuspend: 0 194 | uIStatusBarStyle: 0 195 | appleTVSplashScreen: {fileID: 0} 196 | appleTVSplashScreen2x: {fileID: 0} 197 | tvOSSmallIconLayers: [] 198 | tvOSSmallIconLayers2x: [] 199 | tvOSLargeIconLayers: [] 200 | tvOSLargeIconLayers2x: [] 201 | tvOSTopShelfImageLayers: [] 202 | tvOSTopShelfImageLayers2x: [] 203 | tvOSTopShelfImageWideLayers: [] 204 | tvOSTopShelfImageWideLayers2x: [] 205 | iOSLaunchScreenType: 0 206 | iOSLaunchScreenPortrait: {fileID: 0} 207 | iOSLaunchScreenLandscape: {fileID: 0} 208 | iOSLaunchScreenBackgroundColor: 209 | serializedVersion: 2 210 | rgba: 0 211 | iOSLaunchScreenFillPct: 100 212 | iOSLaunchScreenSize: 100 213 | iOSLaunchScreenCustomXibPath: 214 | iOSLaunchScreeniPadType: 0 215 | iOSLaunchScreeniPadImage: {fileID: 0} 216 | iOSLaunchScreeniPadBackgroundColor: 217 | serializedVersion: 2 218 | rgba: 0 219 | iOSLaunchScreeniPadFillPct: 100 220 | iOSLaunchScreeniPadSize: 100 221 | iOSLaunchScreeniPadCustomXibPath: 222 | iOSUseLaunchScreenStoryboard: 0 223 | iOSLaunchScreenCustomStoryboardPath: 224 | iOSDeviceRequirements: [] 225 | iOSURLSchemes: [] 226 | iOSBackgroundModes: 0 227 | iOSMetalForceHardShadows: 0 228 | metalEditorSupport: 1 229 | metalAPIValidation: 1 230 | iOSRenderExtraFrameOnPause: 0 231 | appleDeveloperTeamID: 232 | iOSManualSigningProvisioningProfileID: 233 | tvOSManualSigningProvisioningProfileID: 234 | iOSManualSigningProvisioningProfileType: 0 235 | tvOSManualSigningProvisioningProfileType: 0 236 | appleEnableAutomaticSigning: 0 237 | iOSRequireARKit: 0 238 | iOSAutomaticallyDetectAndAddCapabilities: 1 239 | appleEnableProMotion: 0 240 | clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea 241 | templatePackageId: com.unity.template.3d@4.2.8 242 | templateDefaultScene: Assets/Scenes/SampleScene.unity 243 | AndroidTargetArchitectures: 1 244 | AndroidSplashScreenScale: 0 245 | androidSplashScreen: {fileID: 0} 246 | AndroidKeystoreName: 247 | AndroidKeyaliasName: 248 | AndroidBuildApkPerCpuArchitecture: 0 249 | AndroidTVCompatibility: 0 250 | AndroidIsGame: 1 251 | AndroidEnableTango: 0 252 | androidEnableBanner: 1 253 | androidUseLowAccuracyLocation: 0 254 | androidUseCustomKeystore: 0 255 | m_AndroidBanners: 256 | - width: 320 257 | height: 180 258 | banner: {fileID: 0} 259 | androidGamepadSupportLevel: 0 260 | AndroidValidateAppBundleSize: 1 261 | AndroidAppBundleSizeToValidate: 150 262 | m_BuildTargetIcons: [] 263 | m_BuildTargetPlatformIcons: [] 264 | m_BuildTargetBatching: 265 | - m_BuildTarget: Standalone 266 | m_StaticBatching: 1 267 | m_DynamicBatching: 0 268 | - m_BuildTarget: tvOS 269 | m_StaticBatching: 1 270 | m_DynamicBatching: 0 271 | - m_BuildTarget: Android 272 | m_StaticBatching: 1 273 | m_DynamicBatching: 0 274 | - m_BuildTarget: iPhone 275 | m_StaticBatching: 1 276 | m_DynamicBatching: 0 277 | - m_BuildTarget: WebGL 278 | m_StaticBatching: 0 279 | m_DynamicBatching: 0 280 | m_BuildTargetGraphicsJobs: 281 | - m_BuildTarget: MacStandaloneSupport 282 | m_GraphicsJobs: 0 283 | - m_BuildTarget: Switch 284 | m_GraphicsJobs: 1 285 | - m_BuildTarget: MetroSupport 286 | m_GraphicsJobs: 1 287 | - m_BuildTarget: AppleTVSupport 288 | m_GraphicsJobs: 0 289 | - m_BuildTarget: BJMSupport 290 | m_GraphicsJobs: 1 291 | - m_BuildTarget: LinuxStandaloneSupport 292 | m_GraphicsJobs: 1 293 | - m_BuildTarget: PS4Player 294 | m_GraphicsJobs: 1 295 | - m_BuildTarget: iOSSupport 296 | m_GraphicsJobs: 0 297 | - m_BuildTarget: WindowsStandaloneSupport 298 | m_GraphicsJobs: 1 299 | - m_BuildTarget: XboxOnePlayer 300 | m_GraphicsJobs: 1 301 | - m_BuildTarget: LuminSupport 302 | m_GraphicsJobs: 0 303 | - m_BuildTarget: AndroidPlayer 304 | m_GraphicsJobs: 0 305 | - m_BuildTarget: WebGLSupport 306 | m_GraphicsJobs: 0 307 | m_BuildTargetGraphicsJobMode: 308 | - m_BuildTarget: PS4Player 309 | m_GraphicsJobMode: 0 310 | - m_BuildTarget: XboxOnePlayer 311 | m_GraphicsJobMode: 0 312 | m_BuildTargetGraphicsAPIs: 313 | - m_BuildTarget: AndroidPlayer 314 | m_APIs: 150000000b000000 315 | m_Automatic: 0 316 | - m_BuildTarget: iOSSupport 317 | m_APIs: 10000000 318 | m_Automatic: 1 319 | - m_BuildTarget: AppleTVSupport 320 | m_APIs: 10000000 321 | m_Automatic: 0 322 | - m_BuildTarget: WebGLSupport 323 | m_APIs: 0b000000 324 | m_Automatic: 1 325 | m_BuildTargetVRSettings: 326 | - m_BuildTarget: Standalone 327 | m_Enabled: 0 328 | m_Devices: 329 | - Oculus 330 | - OpenVR 331 | openGLRequireES31: 0 332 | openGLRequireES31AEP: 0 333 | openGLRequireES32: 0 334 | m_TemplateCustomTags: {} 335 | mobileMTRendering: 336 | Android: 1 337 | iPhone: 1 338 | tvOS: 1 339 | m_BuildTargetGroupLightmapEncodingQuality: [] 340 | m_BuildTargetGroupLightmapSettings: [] 341 | playModeTestRunnerEnabled: 0 342 | runPlayModeTestAsEditModeTest: 0 343 | actionOnDotNetUnhandledException: 1 344 | enableInternalProfiler: 0 345 | logObjCUncaughtExceptions: 1 346 | enableCrashReportAPI: 0 347 | cameraUsageDescription: 348 | locationUsageDescription: 349 | microphoneUsageDescription: 350 | switchNetLibKey: 351 | switchSocketMemoryPoolSize: 6144 352 | switchSocketAllocatorPoolSize: 128 353 | switchSocketConcurrencyLimit: 14 354 | switchScreenResolutionBehavior: 2 355 | switchUseCPUProfiler: 0 356 | switchApplicationID: 0x01004b9000490000 357 | switchNSODependencies: 358 | switchTitleNames_0: 359 | switchTitleNames_1: 360 | switchTitleNames_2: 361 | switchTitleNames_3: 362 | switchTitleNames_4: 363 | switchTitleNames_5: 364 | switchTitleNames_6: 365 | switchTitleNames_7: 366 | switchTitleNames_8: 367 | switchTitleNames_9: 368 | switchTitleNames_10: 369 | switchTitleNames_11: 370 | switchTitleNames_12: 371 | switchTitleNames_13: 372 | switchTitleNames_14: 373 | switchPublisherNames_0: 374 | switchPublisherNames_1: 375 | switchPublisherNames_2: 376 | switchPublisherNames_3: 377 | switchPublisherNames_4: 378 | switchPublisherNames_5: 379 | switchPublisherNames_6: 380 | switchPublisherNames_7: 381 | switchPublisherNames_8: 382 | switchPublisherNames_9: 383 | switchPublisherNames_10: 384 | switchPublisherNames_11: 385 | switchPublisherNames_12: 386 | switchPublisherNames_13: 387 | switchPublisherNames_14: 388 | switchIcons_0: {fileID: 0} 389 | switchIcons_1: {fileID: 0} 390 | switchIcons_2: {fileID: 0} 391 | switchIcons_3: {fileID: 0} 392 | switchIcons_4: {fileID: 0} 393 | switchIcons_5: {fileID: 0} 394 | switchIcons_6: {fileID: 0} 395 | switchIcons_7: {fileID: 0} 396 | switchIcons_8: {fileID: 0} 397 | switchIcons_9: {fileID: 0} 398 | switchIcons_10: {fileID: 0} 399 | switchIcons_11: {fileID: 0} 400 | switchIcons_12: {fileID: 0} 401 | switchIcons_13: {fileID: 0} 402 | switchIcons_14: {fileID: 0} 403 | switchSmallIcons_0: {fileID: 0} 404 | switchSmallIcons_1: {fileID: 0} 405 | switchSmallIcons_2: {fileID: 0} 406 | switchSmallIcons_3: {fileID: 0} 407 | switchSmallIcons_4: {fileID: 0} 408 | switchSmallIcons_5: {fileID: 0} 409 | switchSmallIcons_6: {fileID: 0} 410 | switchSmallIcons_7: {fileID: 0} 411 | switchSmallIcons_8: {fileID: 0} 412 | switchSmallIcons_9: {fileID: 0} 413 | switchSmallIcons_10: {fileID: 0} 414 | switchSmallIcons_11: {fileID: 0} 415 | switchSmallIcons_12: {fileID: 0} 416 | switchSmallIcons_13: {fileID: 0} 417 | switchSmallIcons_14: {fileID: 0} 418 | switchManualHTML: 419 | switchAccessibleURLs: 420 | switchLegalInformation: 421 | switchMainThreadStackSize: 1048576 422 | switchPresenceGroupId: 423 | switchLogoHandling: 0 424 | switchReleaseVersion: 0 425 | switchDisplayVersion: 1.0.0 426 | switchStartupUserAccount: 0 427 | switchTouchScreenUsage: 0 428 | switchSupportedLanguagesMask: 0 429 | switchLogoType: 0 430 | switchApplicationErrorCodeCategory: 431 | switchUserAccountSaveDataSize: 0 432 | switchUserAccountSaveDataJournalSize: 0 433 | switchApplicationAttribute: 0 434 | switchCardSpecSize: -1 435 | switchCardSpecClock: -1 436 | switchRatingsMask: 0 437 | switchRatingsInt_0: 0 438 | switchRatingsInt_1: 0 439 | switchRatingsInt_2: 0 440 | switchRatingsInt_3: 0 441 | switchRatingsInt_4: 0 442 | switchRatingsInt_5: 0 443 | switchRatingsInt_6: 0 444 | switchRatingsInt_7: 0 445 | switchRatingsInt_8: 0 446 | switchRatingsInt_9: 0 447 | switchRatingsInt_10: 0 448 | switchRatingsInt_11: 0 449 | switchRatingsInt_12: 0 450 | switchLocalCommunicationIds_0: 451 | switchLocalCommunicationIds_1: 452 | switchLocalCommunicationIds_2: 453 | switchLocalCommunicationIds_3: 454 | switchLocalCommunicationIds_4: 455 | switchLocalCommunicationIds_5: 456 | switchLocalCommunicationIds_6: 457 | switchLocalCommunicationIds_7: 458 | switchParentalControl: 0 459 | switchAllowsScreenshot: 1 460 | switchAllowsVideoCapturing: 1 461 | switchAllowsRuntimeAddOnContentInstall: 0 462 | switchDataLossConfirmation: 0 463 | switchUserAccountLockEnabled: 0 464 | switchSystemResourceMemory: 16777216 465 | switchSupportedNpadStyles: 22 466 | switchNativeFsCacheSize: 32 467 | switchIsHoldTypeHorizontal: 0 468 | switchSupportedNpadCount: 8 469 | switchSocketConfigEnabled: 0 470 | switchTcpInitialSendBufferSize: 32 471 | switchTcpInitialReceiveBufferSize: 64 472 | switchTcpAutoSendBufferSizeMax: 256 473 | switchTcpAutoReceiveBufferSizeMax: 256 474 | switchUdpSendBufferSize: 9 475 | switchUdpReceiveBufferSize: 42 476 | switchSocketBufferEfficiency: 4 477 | switchSocketInitializeEnabled: 1 478 | switchNetworkInterfaceManagerInitializeEnabled: 1 479 | switchPlayerConnectionEnabled: 1 480 | ps4NPAgeRating: 12 481 | ps4NPTitleSecret: 482 | ps4NPTrophyPackPath: 483 | ps4ParentalLevel: 11 484 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 485 | ps4Category: 0 486 | ps4MasterVersion: 01.00 487 | ps4AppVersion: 01.00 488 | ps4AppType: 0 489 | ps4ParamSfxPath: 490 | ps4VideoOutPixelFormat: 0 491 | ps4VideoOutInitialWidth: 1920 492 | ps4VideoOutBaseModeInitialWidth: 1920 493 | ps4VideoOutReprojectionRate: 60 494 | ps4PronunciationXMLPath: 495 | ps4PronunciationSIGPath: 496 | ps4BackgroundImagePath: 497 | ps4StartupImagePath: 498 | ps4StartupImagesFolder: 499 | ps4IconImagesFolder: 500 | ps4SaveDataImagePath: 501 | ps4SdkOverride: 502 | ps4BGMPath: 503 | ps4ShareFilePath: 504 | ps4ShareOverlayImagePath: 505 | ps4PrivacyGuardImagePath: 506 | ps4NPtitleDatPath: 507 | ps4RemotePlayKeyAssignment: -1 508 | ps4RemotePlayKeyMappingDir: 509 | ps4PlayTogetherPlayerCount: 0 510 | ps4EnterButtonAssignment: 1 511 | ps4ApplicationParam1: 0 512 | ps4ApplicationParam2: 0 513 | ps4ApplicationParam3: 0 514 | ps4ApplicationParam4: 0 515 | ps4DownloadDataSize: 0 516 | ps4GarlicHeapSize: 2048 517 | ps4ProGarlicHeapSize: 2560 518 | playerPrefsMaxSize: 32768 519 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 520 | ps4pnSessions: 1 521 | ps4pnPresence: 1 522 | ps4pnFriends: 1 523 | ps4pnGameCustomData: 1 524 | playerPrefsSupport: 0 525 | enableApplicationExit: 0 526 | resetTempFolder: 1 527 | restrictedAudioUsageRights: 0 528 | ps4UseResolutionFallback: 0 529 | ps4ReprojectionSupport: 0 530 | ps4UseAudio3dBackend: 0 531 | ps4UseLowGarlicFragmentationMode: 1 532 | ps4SocialScreenEnabled: 0 533 | ps4ScriptOptimizationLevel: 0 534 | ps4Audio3dVirtualSpeakerCount: 14 535 | ps4attribCpuUsage: 0 536 | ps4PatchPkgPath: 537 | ps4PatchLatestPkgPath: 538 | ps4PatchChangeinfoPath: 539 | ps4PatchDayOne: 0 540 | ps4attribUserManagement: 0 541 | ps4attribMoveSupport: 0 542 | ps4attrib3DSupport: 0 543 | ps4attribShareSupport: 0 544 | ps4attribExclusiveVR: 0 545 | ps4disableAutoHideSplash: 0 546 | ps4videoRecordingFeaturesUsed: 0 547 | ps4contentSearchFeaturesUsed: 0 548 | ps4attribEyeToEyeDistanceSettingVR: 0 549 | ps4IncludedModules: [] 550 | ps4attribVROutputEnabled: 0 551 | monoEnv: 552 | splashScreenBackgroundSourceLandscape: {fileID: 0} 553 | splashScreenBackgroundSourcePortrait: {fileID: 0} 554 | blurSplashScreenBackground: 1 555 | spritePackerPolicy: 556 | webGLMemorySize: 16 557 | webGLExceptionSupport: 1 558 | webGLNameFilesAsHashes: 0 559 | webGLDataCaching: 1 560 | webGLDebugSymbols: 0 561 | webGLEmscriptenArgs: 562 | webGLModulesDirectory: 563 | webGLTemplate: APPLICATION:Default 564 | webGLAnalyzeBuildSize: 0 565 | webGLUseEmbeddedResources: 0 566 | webGLCompressionFormat: 1 567 | webGLLinkerTarget: 1 568 | webGLThreadsSupport: 0 569 | webGLWasmStreaming: 0 570 | scriptingDefineSymbols: 571 | 1: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER 572 | 4: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER 573 | 7: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER 574 | 13: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER 575 | 14: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER 576 | 19: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER 577 | 21: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER 578 | 25: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER 579 | 27: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER 580 | 28: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER 581 | 29: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER 582 | platformArchitecture: {} 583 | scriptingBackend: {} 584 | il2cppCompilerConfiguration: {} 585 | managedStrippingLevel: {} 586 | incrementalIl2cppBuild: {} 587 | allowUnsafeCode: 0 588 | additionalIl2CppArgs: 589 | scriptingRuntimeVersion: 1 590 | gcIncremental: 0 591 | gcWBarrierValidation: 0 592 | apiCompatibilityLevelPerPlatform: {} 593 | m_RenderingPath: 1 594 | m_MobileRenderingPath: 1 595 | metroPackageName: Template_3D 596 | metroPackageVersion: 597 | metroCertificatePath: 598 | metroCertificatePassword: 599 | metroCertificateSubject: 600 | metroCertificateIssuer: 601 | metroCertificateNotAfter: 0000000000000000 602 | metroApplicationDescription: Template_3D 603 | wsaImages: {} 604 | metroTileShortName: 605 | metroTileShowName: 0 606 | metroMediumTileShowName: 0 607 | metroLargeTileShowName: 0 608 | metroWideTileShowName: 0 609 | metroSupportStreamingInstall: 0 610 | metroLastRequiredScene: 0 611 | metroDefaultTileSize: 1 612 | metroTileForegroundText: 2 613 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 614 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 615 | a: 1} 616 | metroSplashScreenUseBackgroundColor: 0 617 | platformCapabilities: {} 618 | metroTargetDeviceFamilies: {} 619 | metroFTAName: 620 | metroFTAFileTypes: [] 621 | metroProtocolName: 622 | XboxOneProductId: 623 | XboxOneUpdateKey: 624 | XboxOneSandboxId: 625 | XboxOneContentId: 626 | XboxOneTitleId: 627 | XboxOneSCId: 628 | XboxOneGameOsOverridePath: 629 | XboxOnePackagingOverridePath: 630 | XboxOneAppManifestOverridePath: 631 | XboxOneVersion: 1.0.0.0 632 | XboxOnePackageEncryption: 0 633 | XboxOnePackageUpdateGranularity: 2 634 | XboxOneDescription: 635 | XboxOneLanguage: 636 | - enus 637 | XboxOneCapability: [] 638 | XboxOneGameRating: {} 639 | XboxOneIsContentPackage: 0 640 | XboxOneEnableGPUVariability: 1 641 | XboxOneSockets: {} 642 | XboxOneSplashScreen: {fileID: 0} 643 | XboxOneAllowedProductIds: [] 644 | XboxOnePersistentLocalStorageSize: 0 645 | XboxOneXTitleMemory: 8 646 | XboxOneOverrideIdentityName: 647 | XboxOneOverrideIdentityPublisher: 648 | vrEditorSettings: 649 | daydream: 650 | daydreamIconForeground: {fileID: 0} 651 | daydreamIconBackground: {fileID: 0} 652 | cloudServicesEnabled: 653 | UNet: 1 654 | luminIcon: 655 | m_Name: 656 | m_ModelFolderPath: 657 | m_PortalFolderPath: 658 | luminCert: 659 | m_CertPath: 660 | m_SignPackage: 1 661 | luminIsChannelApp: 0 662 | luminVersion: 663 | m_VersionCode: 1 664 | m_VersionName: 665 | apiCompatibilityLevel: 6 666 | cloudProjectId: 667 | framebufferDepthMemorylessMode: 0 668 | projectName: 669 | organizationId: 670 | cloudEnabled: 0 671 | enableNativePlatformBackendsForNewInputSystem: 0 672 | disableOldInputManagerSupport: 0 673 | legacyClampBlendShapeWeights: 0 674 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2022.3.31f1 2 | m_EditorVersionWithRevision: 2022.3.31f1 (4ede2d13e8b4) 3 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | excludedTargetPlatforms: [] 44 | - serializedVersion: 2 45 | name: Low 46 | pixelLightCount: 0 47 | shadows: 0 48 | shadowResolution: 0 49 | shadowProjection: 1 50 | shadowCascades: 1 51 | shadowDistance: 20 52 | shadowNearPlaneOffset: 3 53 | shadowCascade2Split: 0.33333334 54 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 55 | shadowmaskMode: 0 56 | blendWeights: 2 57 | textureQuality: 0 58 | anisotropicTextures: 0 59 | antiAliasing: 0 60 | softParticles: 0 61 | softVegetation: 0 62 | realtimeReflectionProbes: 0 63 | billboardsFaceCameraPosition: 0 64 | vSyncCount: 0 65 | lodBias: 0.4 66 | maximumLODLevel: 0 67 | streamingMipmapsActive: 0 68 | streamingMipmapsAddAllCameras: 1 69 | streamingMipmapsMemoryBudget: 512 70 | streamingMipmapsRenderersPerFrame: 512 71 | streamingMipmapsMaxLevelReduction: 2 72 | streamingMipmapsMaxFileIORequests: 1024 73 | particleRaycastBudget: 16 74 | asyncUploadTimeSlice: 2 75 | asyncUploadBufferSize: 16 76 | asyncUploadPersistentBuffer: 1 77 | resolutionScalingFixedDPIFactor: 1 78 | excludedTargetPlatforms: [] 79 | - serializedVersion: 2 80 | name: Medium 81 | pixelLightCount: 1 82 | shadows: 1 83 | shadowResolution: 0 84 | shadowProjection: 1 85 | shadowCascades: 1 86 | shadowDistance: 20 87 | shadowNearPlaneOffset: 3 88 | shadowCascade2Split: 0.33333334 89 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 90 | shadowmaskMode: 0 91 | blendWeights: 2 92 | textureQuality: 0 93 | anisotropicTextures: 1 94 | antiAliasing: 0 95 | softParticles: 0 96 | softVegetation: 0 97 | realtimeReflectionProbes: 0 98 | billboardsFaceCameraPosition: 0 99 | vSyncCount: 1 100 | lodBias: 0.7 101 | maximumLODLevel: 0 102 | streamingMipmapsActive: 0 103 | streamingMipmapsAddAllCameras: 1 104 | streamingMipmapsMemoryBudget: 512 105 | streamingMipmapsRenderersPerFrame: 512 106 | streamingMipmapsMaxLevelReduction: 2 107 | streamingMipmapsMaxFileIORequests: 1024 108 | particleRaycastBudget: 64 109 | asyncUploadTimeSlice: 2 110 | asyncUploadBufferSize: 16 111 | asyncUploadPersistentBuffer: 1 112 | resolutionScalingFixedDPIFactor: 1 113 | excludedTargetPlatforms: [] 114 | - serializedVersion: 2 115 | name: High 116 | pixelLightCount: 2 117 | shadows: 2 118 | shadowResolution: 1 119 | shadowProjection: 1 120 | shadowCascades: 2 121 | shadowDistance: 40 122 | shadowNearPlaneOffset: 3 123 | shadowCascade2Split: 0.33333334 124 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 125 | shadowmaskMode: 1 126 | blendWeights: 2 127 | textureQuality: 0 128 | anisotropicTextures: 1 129 | antiAliasing: 0 130 | softParticles: 0 131 | softVegetation: 1 132 | realtimeReflectionProbes: 1 133 | billboardsFaceCameraPosition: 1 134 | vSyncCount: 1 135 | lodBias: 1 136 | maximumLODLevel: 0 137 | streamingMipmapsActive: 0 138 | streamingMipmapsAddAllCameras: 1 139 | streamingMipmapsMemoryBudget: 512 140 | streamingMipmapsRenderersPerFrame: 512 141 | streamingMipmapsMaxLevelReduction: 2 142 | streamingMipmapsMaxFileIORequests: 1024 143 | particleRaycastBudget: 256 144 | asyncUploadTimeSlice: 2 145 | asyncUploadBufferSize: 16 146 | asyncUploadPersistentBuffer: 1 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Very High 151 | pixelLightCount: 3 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 2 156 | shadowDistance: 70 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 1.5 171 | maximumLODLevel: 0 172 | streamingMipmapsActive: 0 173 | streamingMipmapsAddAllCameras: 1 174 | streamingMipmapsMemoryBudget: 512 175 | streamingMipmapsRenderersPerFrame: 512 176 | streamingMipmapsMaxLevelReduction: 2 177 | streamingMipmapsMaxFileIORequests: 1024 178 | particleRaycastBudget: 1024 179 | asyncUploadTimeSlice: 2 180 | asyncUploadBufferSize: 16 181 | asyncUploadPersistentBuffer: 1 182 | resolutionScalingFixedDPIFactor: 1 183 | excludedTargetPlatforms: [] 184 | - serializedVersion: 2 185 | name: Ultra 186 | pixelLightCount: 4 187 | shadows: 2 188 | shadowResolution: 2 189 | shadowProjection: 1 190 | shadowCascades: 4 191 | shadowDistance: 150 192 | shadowNearPlaneOffset: 3 193 | shadowCascade2Split: 0.33333334 194 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 195 | shadowmaskMode: 1 196 | blendWeights: 4 197 | textureQuality: 0 198 | anisotropicTextures: 2 199 | antiAliasing: 2 200 | softParticles: 1 201 | softVegetation: 1 202 | realtimeReflectionProbes: 1 203 | billboardsFaceCameraPosition: 1 204 | vSyncCount: 1 205 | lodBias: 2 206 | maximumLODLevel: 0 207 | streamingMipmapsActive: 0 208 | streamingMipmapsAddAllCameras: 1 209 | streamingMipmapsMemoryBudget: 512 210 | streamingMipmapsRenderersPerFrame: 512 211 | streamingMipmapsMaxLevelReduction: 2 212 | streamingMipmapsMaxFileIORequests: 1024 213 | particleRaycastBudget: 4096 214 | asyncUploadTimeSlice: 2 215 | asyncUploadBufferSize: 16 216 | asyncUploadPersistentBuffer: 1 217 | resolutionScalingFixedDPIFactor: 1 218 | excludedTargetPlatforms: [] 219 | m_PerPlatformDefaultQuality: 220 | Android: 2 221 | Lumin: 5 222 | Nintendo 3DS: 5 223 | Nintendo Switch: 5 224 | PS4: 5 225 | PSP2: 2 226 | Stadia: 5 227 | Standalone: 5 228 | WebGL: 3 229 | Windows Store Apps: 5 230 | XboxOne: 5 231 | iPhone: 2 232 | tvOS: 2 233 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Pun2Task 2 | 3 | このライブラリを用いると`Photon Unity Networking 2`で`async/await`が利用可能になります。 4 | 5 | This library enables `async/await` in `Photon Unity Networking 2`. 6 | 7 | ## LICENSE 8 | 9 | MIT License. 10 | 11 | ## 依存ライブラリ/dependency 12 | 13 | - [UniTask](https://github.com/Cysharp/UniTask) 14 | 15 | ## 導入/Getting started 16 | 17 | ### 1. Download 18 | 19 | #### A. Release Page 20 | 21 | - [here](https://github.com/TORISOUP/Pun2Task/releases) 22 | 23 | #### B. UnityPackageManager 24 | 25 | `Packages/manifest.json`に以下を追記。 26 | 27 | ``` 28 | "scopedRegistries": [ 29 | { 30 | "name": "package.openupm.com", 31 | "url": "https://package.openupm.com", 32 | "scopes": [ 33 | "com.cysharp.unitask", 34 | "com.openupm" 35 | ] 36 | } 37 | ] 38 | ``` 39 | 40 | 追記したのちに`Package Manager`の`Add package from git URL...`に以下を追加。 41 | 42 | ![image](https://user-images.githubusercontent.com/861868/101975816-d7457300-3c82-11eb-9c17-07805e7c3b52.png) 43 | 44 | ``` 45 | https://github.com/TORISOUP/Pun2Task.git?path=Assets/Plugins/Pun2Task#1.1.0 46 | ``` 47 | 48 | 49 | ### 2. Add UniTask 50 | 51 | パッケージマネージャを利用せずにUniTaskを導入した場合は**PUN_TO_UNITASK_SUPPORT**を`Scripting Define Symbols`に追加してください。 52 | 53 | If you installed UniTask without using the package manager, add **PUN_TO_UNITASK_SUPPORT** to your `Scripting Define Symbols`. 54 | 55 | 56 | ## 挙動の説明 / Behavior 57 | 58 | ### Pun2TaskNetwork 59 | 60 | `Pun2TaskNetwork`はPUN2の`PhotonNetwork`のAPIを非同期的に実行できるようにするstaticクラスです。実装としては`PhotonNetwork`のAPI呼び出しのラッパーとなっています。 61 | ただし`PhotonNetwork`のAPI呼び出しと異なる点として、APIの実行に失敗した場合は必ず`InvalidNetworkOperationException`を発行します。 62 | 63 | `Pun2TaskNetwork` is a static class that allows asynchronous execution of PUN2's `PhotonNetwork` API. As an implementation, it is a wrapper for the `PhotonNetwork` API calls. 64 | However, it differs from `PhotonNetwork` in that it always issues an `InvalidNetworkOperationException` if the API fails to execute. 65 | 66 | ```cs 67 | private void ConnectSample() 68 | { 69 | // 元のAPIは呼び出しに失敗した場合は false を返す 70 | // The original API returns false if the call fails. 71 | if (!PhotonNetwork.ConnectUsingSettings()) 72 | { 73 | Debug.LogError("Error: ConnectUsingSettings failed."); 74 | } 75 | else 76 | { 77 | Debug.Log("Connected to master server."); 78 | } 79 | } 80 | 81 | private async UniTaskVoid ConnectionSampleAsync(CancellationToken token) 82 | { 83 | try 84 | { 85 | // Pun2TaskNetworkでは失敗時は必ず例外を発行する 86 | // Pun2TaskNetwork always throws an exception when it fails. 87 | await Pun2TaskNetwork.ConnectUsingSettingsAsync(token); 88 | 89 | Debug.Log("Connected to master server."); 90 | } 91 | catch (Pun2TaskNetwork.InvalidNetworkOperationException ex) 92 | { 93 | // 設定値不足などでそもそも接続処理自体が実行できない場合は例外 94 | // When the connection process itself cannot be executed due to insufficient settings, etc. 95 | Debug.LogError(ex); 96 | } 97 | catch (Pun2TaskNetwork.ConnectionFailedException ex) 98 | { 99 | // 接続失敗時は例外 100 | // Throw ConnectionFailedException when 'OnDisconnected' called. 101 | Debug.LogError(ex); 102 | } 103 | } 104 | ``` 105 | 106 | 107 | ## 使い方/How to use 108 | 109 | 110 | ### Connect to Photon server 111 | 112 | Use `Pun2TaskNetwork.ConnectUsingSettingsAsync()`. 113 | 114 | ```cs 115 | private async UniTaskVoid ConnectionSampleAsync(CancellationToken token) 116 | { 117 | try 118 | { 119 | // OnConnectedToMaster が呼び出されるのを待てる 120 | // You can use async/await to wait for 'OnConnectedToMaster'. 121 | await Pun2TaskNetwork.ConnectUsingSettingsAsync(destroyCancellationToken); 122 | 123 | Debug.Log("Connected to master server."); 124 | } 125 | catch (Pun2TaskNetwork.InvalidNetworkOperationException ex) 126 | { 127 | // 設定値不足などでそもそも接続処理自体が実行できない場合は例外 128 | // When the connection process itself cannot be executed due to insufficient settings, etc. 129 | Debug.LogError(ex); 130 | } 131 | catch (Pun2TaskNetwork.ConnectionFailedException ex) 132 | { 133 | // 接続失敗時は例外 134 | // Throw ConnectionFailedException when 'OnDisconnected' called. 135 | Debug.LogError(ex); 136 | } 137 | } 138 | ``` 139 | 140 | ### Create or join a room 141 | 142 | - `Pun2TaskNetwork.JoinOrCreateRoomAsync` 143 | - `Pun2TaskNetwork.JoinRoomAsync` 144 | - `Pun2TaskNetwork.CreateRoomAsync` 145 | 146 | ```cs 147 | private async UniTaskVoid CreateOrJoinRoomSampleAsync(CancellationToken token) 148 | { 149 | try 150 | { 151 | // ルームへの参加または新規作成 152 | // 部屋を新規作成した場合はTrue 153 | // You can await to join or create a room. 154 | // Return true if you are the first user. 155 | var isFirstUser = await Pun2TaskNetwork.JoinOrCreateRoomAsync( 156 | roomName: "test_room", 157 | roomOptions: default, 158 | typedLobby: default, 159 | token: token); 160 | 161 | Debug.Log("Joined room."); 162 | } 163 | catch (Pun2TaskNetwork.InvalidRoomOperationException ex) 164 | { 165 | // サーバに繋がっていないなど、そもそもメソッドが実行できなかった 166 | // Not connected to the master server, etc. 167 | Debug.LogError(ex); 168 | } 169 | catch (Pun2TaskNetwork.FailedToCreateRoomException ex) 170 | { 171 | // 何らかの理由で部屋が作れなかった 172 | // Failed to create a room, etc. 173 | Debug.LogError(ex); 174 | } 175 | catch (Pun2TaskNetwork.FailedToJoinRoomException ex) 176 | { 177 | // 部屋に参加できなかった。 178 | // Failed to join a room, etc. 179 | Debug.LogError(ex); 180 | } 181 | } 182 | ``` 183 | 184 | ### Callbacks 185 | 186 | 各種コールバックは`Pun2TaskCallback`を用いることで、async/awaitとして扱うことができます。 187 | 188 | Each callback can be treated as an async/await by using the `Pun2TaskCallback`. 189 | 190 | ```cs 191 | private async UniTaskVoid Callbacks(CancellationToken token) 192 | { 193 | // 各種コールバックを待てる 194 | // You can await connection callbacks. 195 | await Pun2TaskCallback.OnConnectedAsync(token); 196 | await Pun2TaskCallback.OnCreatedRoomAsync(token); 197 | await Pun2TaskCallback.OnJoinedRoomAsync(token); 198 | await Pun2TaskCallback.OnLeftRoomAsync(token); 199 | // etc. 200 | 201 | // パラメータの取得も可能 202 | // You can get the parameters. 203 | DisconnectCause disconnectCause = await Pun2TaskCallback.OnDisconnectedAsync(token); 204 | Player newPlayer = await Pun2TaskCallback.OnPlayerEnteredRoomAsync(token); 205 | Player leftPlayer = await Pun2TaskCallback.OnPlayerLeftRoomAsync(token); 206 | // etc. 207 | 208 | // OnPlayerEnteredRoom and OnPlayerLeftRoomAsync can be treated as UniTaskAsyncEnumerable. 209 | Pun2TaskCallback 210 | .OnPlayerEnteredRoomAsyncEnumerable() 211 | .ForEachAsync(x => Debug.Log(x.NickName), cancellationToken: token); 212 | 213 | Pun2TaskCallback 214 | .OnPlayerLeftRoomAsyncEnumerable() 215 | .ForEachAsync(x => Debug.Log(x.NickName), cancellationToken: token); 216 | } 217 | ``` 218 | 219 | ### PhotonView 220 | 221 | 所有権の取得をasync/awaitで管理できます。 222 | 223 | You can manage the ownership takeover with async/await. 224 | 225 | ```cs 226 | public class SampleView : MonoBehaviourPun 227 | { 228 | private void Start() 229 | { 230 | // 所有権の遷移を IUniTaskAsyncEnumerable で監視できる。 231 | // You can monitor ownership transitions with IUniTaskAsyncEnumerable. 232 | photonView 233 | .IsMineAsyncEnumerable() 234 | .Subscribe(x => 235 | { 236 | // 所有者が変化したら通知される。 237 | // Notified when ownership changes. 238 | Debug.Log($"IsMine = {x}"); 239 | }) 240 | .AddTo(this.GetCancellationTokenOnDestroy()); 241 | } 242 | 243 | public void Update() 244 | { 245 | if (Input.GetKeyDown(KeyCode.A)) 246 | { 247 | UniTask.Void(async () => 248 | { 249 | // 所有権の取得を要求して、それが完了するまでawaitできる。 250 | // You can request ownership and wait until the takeover is complete. 251 | await photonView.RequestOwnershipAsync(); 252 | 253 | Debug.Log("Got ownership!"); 254 | }); 255 | } 256 | } 257 | } 258 | ``` -------------------------------------------------------------------------------- /UserSettings/EditorUserSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!162 &1 4 | EditorUserSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_ConfigSettings: 8 | vcSharedLogLevel: 9 | value: 0d5e400f0650 10 | flags: 0 11 | m_VCAutomaticAdd: 1 12 | m_VCDebugCom: 0 13 | m_VCDebugCmd: 0 14 | m_VCDebugOut: 0 15 | m_SemanticMergeMode: 2 16 | m_DesiredImportWorkerCount: 8 17 | m_StandbyImportWorkerCount: 2 18 | m_IdleImportWorkerShutdownDelay: 60000 19 | m_VCShowFailedCheckout: 1 20 | m_VCOverwriteFailedCheckoutAssets: 1 21 | m_VCProjectOverlayIcons: 1 22 | m_VCHierarchyOverlayIcons: 1 23 | m_VCOtherOverlayIcons: 1 24 | m_VCAllowAsyncUpdate: 1 25 | m_ArtifactGarbageCollection: 1 26 | -------------------------------------------------------------------------------- /UserSettings/Search.settings: -------------------------------------------------------------------------------- 1 | {} --------------------------------------------------------------------------------