완
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
@@ -5,7 +6,9 @@ using UnityEngine;
|
||||
using Photon.Pun;
|
||||
using UnityEngine.Networking;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
using Hashtable = ExitGames.Client.Photon.Hashtable;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
public class GameManager : MonoBehaviourPunCallbacks
|
||||
{
|
||||
@@ -13,6 +16,10 @@ public class GameManager : MonoBehaviourPunCallbacks
|
||||
public GameObject readyPanel;
|
||||
public GameObject restartButton;
|
||||
public GameObject destroyRoomButton;
|
||||
public GameObject map;
|
||||
|
||||
private Image _image;
|
||||
private float _fillAmount = 1f;
|
||||
|
||||
public static Dictionary<int, Sprite> AvatarCache = new Dictionary<int, Sprite>();
|
||||
|
||||
@@ -20,6 +27,7 @@ public class GameManager : MonoBehaviourPunCallbacks
|
||||
{
|
||||
if (restartButton != null) restartButton.SetActive(false);
|
||||
if (destroyRoomButton != null) destroyRoomButton.SetActive(false); // [추가]
|
||||
_image = map.GetComponent<Image>();
|
||||
// 씬 시작 시, 모두의 아바타를 다운로드하는 코루틴 시작
|
||||
StartCoroutine(DownloadAllAvatarsAndReady());
|
||||
}
|
||||
@@ -58,7 +66,7 @@ public class GameManager : MonoBehaviourPunCallbacks
|
||||
|
||||
if (request.result != UnityWebRequest.Result.Success)
|
||||
{
|
||||
Debug.LogError($"[다운로드 실패] 유저 번호: {actorNumber}, 에러: {request.error}");
|
||||
Debug.LogError($"[다운로드 실패] 유저 번호: {actorNumber}, 에러: {request.error}\nwhile Downloading {url}");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -88,6 +96,13 @@ public class GameManager : MonoBehaviourPunCallbacks
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (!Gazuaa.isGameActive) return;
|
||||
_fillAmount -= Time.deltaTime;
|
||||
_image.fillAmount = _fillAmount / 15f; // 15초 동안 서서히 줄어들도록 설정
|
||||
}
|
||||
|
||||
private bool CheckAllPlayersLoaded()
|
||||
{
|
||||
// 방에 있는 모든 플레이어의 "IsLoaded"가 true인지 확인
|
||||
@@ -116,6 +131,7 @@ public class GameManager : MonoBehaviourPunCallbacks
|
||||
|
||||
private IEnumerator GameSet()
|
||||
{
|
||||
_fillAmount = 15;
|
||||
// 1. 카운트다운
|
||||
text.text = "3";
|
||||
yield return new WaitForSeconds(1f);
|
||||
@@ -129,7 +145,6 @@ public class GameManager : MonoBehaviourPunCallbacks
|
||||
|
||||
// --- 게임 시작 ---
|
||||
Gazuaa.isGameActive = true; // 스페이스바 입력 활성화!
|
||||
|
||||
// 2. 15초 동안 게임 진행 (대기)
|
||||
yield return new WaitForSeconds(15f);
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ public class Gazuaa : MonoBehaviourPunCallbacks
|
||||
|
||||
yield return new WaitForSeconds(delay);
|
||||
elapsedTime += delay; // 흐른 시간 누적
|
||||
|
||||
|
||||
// 시간이 지날수록 속도를 살짝 늦춥니다.
|
||||
if (elapsedTime > spinDuration * 0.5f) delay = 0.08f; // 절반 지났을 때
|
||||
if (elapsedTime > spinDuration * 0.8f) delay = 0.15f; // 거의 끝날 때쯤
|
||||
|
||||
@@ -25,8 +25,8 @@ public class LobbyManager : MonoBehaviourPunCallbacks
|
||||
public string[] defaultAvatarUrls = new string[]
|
||||
{
|
||||
"https://scontent-icn2-1.cdninstagram.com/v/t51.82787-19/657402696_17932715739227818_1102219035706293785_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4yMDguYzEifQ&_nc_ht=scontent-icn2-1.cdninstagram.com&_nc_cat=110&_nc_oc=Q6cZ2gEiAmiFEpKqA0_AvOwYhu_V9dtAieTJ6EHLqVEzLZmvyXvRk0RZ7G3n6BO9gVZEKpE&_nc_ohc=X-ML0v44oVcQ7kNvwGmKPj8&_nc_gid=i-J7dc5bYegcPnPIkL9scQ&edm=AP4sbd4BAAAA&ccb=7-5&oh=00_Af7RgrBAKQfl7RpZSpdbPpPbKvVYuz5RYk93sONhI1Yrrw&oe=69F9A119&_nc_sid=7a9f4b", // 여기에 미리 쓸 URL들을 넣어주세요.
|
||||
"https://i.namu.wiki/i/0uubPPIF2f9mKDb2fD19gMa77g2rUpoDnQ5Ekb9iqSNea2sfq9u9eWmRUGZFMIOy77XxnSI0HrIfTBj-U-wt4Q.webp",
|
||||
"https://i.namu.wiki/i/Ob0--Jok1pkNtNu46VjPmTZWbmaql5Xf0pexZ5RBz3B5Nlj8z_xqYSyMqw70Ad5mEYa_i1GHcHda5pbilvBNOA.webp"
|
||||
"https://i.pinimg.com/736x/8a/ac/0d/8aac0d13a68269655eccab58f0951f0d.jpg",
|
||||
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSUADRqIoQ68Ob7NoTHE4sIq_4RU9aKSzimmw&s"
|
||||
};
|
||||
|
||||
void Start()
|
||||
|
||||
Reference in New Issue
Block a user