From 66381935247830156fa6bd764649ae512da22cc7 Mon Sep 17 00:00:00 2001 From: dal4segno Date: Thu, 29 Jan 2026 16:55:16 +0900 Subject: [PATCH] =?UTF-8?q?=ED=83=80=EC=9D=B4=EB=A8=B8=EC=97=90=20?= =?UTF-8?q?=EC=B2=98=EC=9D=8C=20=EC=8B=9C=EC=9E=91=20=EC=8B=9C=EA=B0=84=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 적 포탈 위치 조정 --- Assets/Prefabs/Player.prefab | 4 +- Assets/Scenes/GameMain.unity | 69 ++++++++++++++++++++++++++++++++--- Assets/Scripts/GlobalTimer.cs | 41 ++++++++++++++------- 3 files changed, 94 insertions(+), 20 deletions(-) diff --git a/Assets/Prefabs/Player.prefab b/Assets/Prefabs/Player.prefab index 1f96f27..4f292c3 100644 --- a/Assets/Prefabs/Player.prefab +++ b/Assets/Prefabs/Player.prefab @@ -171,7 +171,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: Assembly-CSharp::Northbound.PlayerInteraction ShowTopMostFoldoutHeaderGroup: 1 - interactionRange: 5 + interactionRange: 2 interactableLayer: serializedVersion: 2 m_Bits: 128 @@ -211,7 +211,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: Assembly-CSharp::Northbound.AttackAction ShowTopMostFoldoutHeaderGroup: 1 - attackRange: 5 + attackRange: 3 attackDamage: 100 attackCooldown: 0.5 attackableLayer: diff --git a/Assets/Scenes/GameMain.unity b/Assets/Scenes/GameMain.unity index d023bee..679b3bf 100644 --- a/Assets/Scenes/GameMain.unity +++ b/Assets/Scenes/GameMain.unity @@ -1700,6 +1700,63 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1053830687} m_CullTransparentMesh: 1 +--- !u!1001 &1061936651 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3} + propertyPath: m_LocalPosition.x + value: 20 + objectReference: {fileID: 0} + - target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3} + propertyPath: m_LocalPosition.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3} + propertyPath: m_LocalPosition.z + value: 650 + objectReference: {fileID: 0} + - target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432047510330746227, guid: 11e3760dda2c0164abf759c18d918893, type: 3} + propertyPath: m_Name + value: EnemyPortal (1) + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 11e3760dda2c0164abf759c18d918893, type: 3} --- !u!1 &1068750868 GameObject: m_ObjectHideFlags: 0 @@ -2120,9 +2177,10 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: Assembly-CSharp::Northbound.GlobalTimer ShowTopMostFoldoutHeaderGroup: 1 - cycleLength: 1 + cycleLength: 90 autoStart: 1 - pauseOnZero: 1 + pauseOnZero: 0 + exceptionalFirstCycleLength: 10 showDebugLogs: 1 --- !u!4 &1442785555 Transform: @@ -2958,15 +3016,15 @@ PrefabInstance: m_Modifications: - target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3} propertyPath: m_LocalPosition.x - value: -19.4593 + value: -20 objectReference: {fileID: 0} - target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3} propertyPath: m_LocalPosition.y - value: 1.00002 + value: 1 objectReference: {fileID: 0} - target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3} propertyPath: m_LocalPosition.z - value: -58.8717 + value: 650 objectReference: {fileID: 0} - target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3} propertyPath: m_LocalRotation.w @@ -3505,3 +3563,4 @@ SceneRoots: - {fileID: 1572384099} - {fileID: 1442785555} - {fileID: 1440648431994998967} + - {fileID: 1061936651} diff --git a/Assets/Scripts/GlobalTimer.cs b/Assets/Scripts/GlobalTimer.cs index f575666..f392a04 100644 --- a/Assets/Scripts/GlobalTimer.cs +++ b/Assets/Scripts/GlobalTimer.cs @@ -15,10 +15,12 @@ namespace Northbound public float cycleLength = 60f; // 한 주기 길이 (초) public bool autoStart = true; public bool pauseOnZero = false; // 0에 도달하면 일시정지 + public float exceptionalFirstCycleLength = 0; [Header("Debug")] public bool showDebugLogs = false; + // 현재 타이머 값 (초) private NetworkVariable _currentTime = new NetworkVariable( 0f, @@ -47,6 +49,7 @@ namespace Northbound public event Action OnHalfwayPoint; // 사이클 중간 지점 private bool _hasReachedHalfway; + private bool _isFirstTime = true; private void Awake() { @@ -56,6 +59,8 @@ namespace Northbound return; } Instance = this; + + _isFirstTime = exceptionalFirstCycleLength > 0 ? true : false; } public override void OnNetworkSpawn() @@ -83,23 +88,33 @@ namespace Northbound _currentTime.Value -= Time.deltaTime; - // 중간 지점 체크 - if (!_hasReachedHalfway && _currentTime.Value <= cycleLength / 2f) + if (_isFirstTime) { - _hasReachedHalfway = true; - OnHalfwayPoint?.Invoke(cycleLength / 2f); - NotifyHalfwayClientRpc(); - - if (showDebugLogs) - Debug.Log($"[GlobalTimer] 사이클 중간 지점 도달"); + if (_currentTime.Value + exceptionalFirstCycleLength < cycleLength) + { + _isFirstTime = false; + CompleteCycle(); + } } - - // 사이클 완료 - if (_currentTime.Value <= 0f) + else { - CompleteCycle(); - } + // 중간 지점 체크 + if (!_hasReachedHalfway && _currentTime.Value <= cycleLength / 2f) + { + _hasReachedHalfway = true; + OnHalfwayPoint?.Invoke(cycleLength / 2f); + NotifyHalfwayClientRpc(); + if (showDebugLogs) + Debug.Log($"[GlobalTimer] 사이클 중간 지점 도달"); + } + + // 사이클 완료 + if (_currentTime.Value <= 0f) + { + CompleteCycle(); + } + } OnTimerTick?.Invoke(_currentTime.Value); }