타이머에 처음 시작 시간 추가
적 포탈 위치 조정
This commit is contained in:
@@ -171,7 +171,7 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier: Assembly-CSharp::Northbound.PlayerInteraction
|
m_EditorClassIdentifier: Assembly-CSharp::Northbound.PlayerInteraction
|
||||||
ShowTopMostFoldoutHeaderGroup: 1
|
ShowTopMostFoldoutHeaderGroup: 1
|
||||||
interactionRange: 5
|
interactionRange: 2
|
||||||
interactableLayer:
|
interactableLayer:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Bits: 128
|
m_Bits: 128
|
||||||
@@ -211,7 +211,7 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier: Assembly-CSharp::Northbound.AttackAction
|
m_EditorClassIdentifier: Assembly-CSharp::Northbound.AttackAction
|
||||||
ShowTopMostFoldoutHeaderGroup: 1
|
ShowTopMostFoldoutHeaderGroup: 1
|
||||||
attackRange: 5
|
attackRange: 3
|
||||||
attackDamage: 100
|
attackDamage: 100
|
||||||
attackCooldown: 0.5
|
attackCooldown: 0.5
|
||||||
attackableLayer:
|
attackableLayer:
|
||||||
|
|||||||
@@ -1700,6 +1700,63 @@ CanvasRenderer:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1053830687}
|
m_GameObject: {fileID: 1053830687}
|
||||||
m_CullTransparentMesh: 1
|
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
|
--- !u!1 &1068750868
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -2120,9 +2177,10 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier: Assembly-CSharp::Northbound.GlobalTimer
|
m_EditorClassIdentifier: Assembly-CSharp::Northbound.GlobalTimer
|
||||||
ShowTopMostFoldoutHeaderGroup: 1
|
ShowTopMostFoldoutHeaderGroup: 1
|
||||||
cycleLength: 1
|
cycleLength: 90
|
||||||
autoStart: 1
|
autoStart: 1
|
||||||
pauseOnZero: 1
|
pauseOnZero: 0
|
||||||
|
exceptionalFirstCycleLength: 10
|
||||||
showDebugLogs: 1
|
showDebugLogs: 1
|
||||||
--- !u!4 &1442785555
|
--- !u!4 &1442785555
|
||||||
Transform:
|
Transform:
|
||||||
@@ -2958,15 +3016,15 @@ PrefabInstance:
|
|||||||
m_Modifications:
|
m_Modifications:
|
||||||
- target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
|
- target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
|
||||||
propertyPath: m_LocalPosition.x
|
propertyPath: m_LocalPosition.x
|
||||||
value: -19.4593
|
value: -20
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
|
- target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
|
||||||
propertyPath: m_LocalPosition.y
|
propertyPath: m_LocalPosition.y
|
||||||
value: 1.00002
|
value: 1
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
|
- target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
|
||||||
propertyPath: m_LocalPosition.z
|
propertyPath: m_LocalPosition.z
|
||||||
value: -58.8717
|
value: 650
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
|
- target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
|
||||||
propertyPath: m_LocalRotation.w
|
propertyPath: m_LocalRotation.w
|
||||||
@@ -3505,3 +3563,4 @@ SceneRoots:
|
|||||||
- {fileID: 1572384099}
|
- {fileID: 1572384099}
|
||||||
- {fileID: 1442785555}
|
- {fileID: 1442785555}
|
||||||
- {fileID: 1440648431994998967}
|
- {fileID: 1440648431994998967}
|
||||||
|
- {fileID: 1061936651}
|
||||||
|
|||||||
@@ -15,10 +15,12 @@ namespace Northbound
|
|||||||
public float cycleLength = 60f; // 한 주기 길이 (초)
|
public float cycleLength = 60f; // 한 주기 길이 (초)
|
||||||
public bool autoStart = true;
|
public bool autoStart = true;
|
||||||
public bool pauseOnZero = false; // 0에 도달하면 일시정지
|
public bool pauseOnZero = false; // 0에 도달하면 일시정지
|
||||||
|
public float exceptionalFirstCycleLength = 0;
|
||||||
|
|
||||||
[Header("Debug")]
|
[Header("Debug")]
|
||||||
public bool showDebugLogs = false;
|
public bool showDebugLogs = false;
|
||||||
|
|
||||||
|
|
||||||
// 현재 타이머 값 (초)
|
// 현재 타이머 값 (초)
|
||||||
private NetworkVariable<float> _currentTime = new NetworkVariable<float>(
|
private NetworkVariable<float> _currentTime = new NetworkVariable<float>(
|
||||||
0f,
|
0f,
|
||||||
@@ -47,6 +49,7 @@ namespace Northbound
|
|||||||
public event Action<float> OnHalfwayPoint; // 사이클 중간 지점
|
public event Action<float> OnHalfwayPoint; // 사이클 중간 지점
|
||||||
|
|
||||||
private bool _hasReachedHalfway;
|
private bool _hasReachedHalfway;
|
||||||
|
private bool _isFirstTime = true;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
@@ -56,6 +59,8 @@ namespace Northbound
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Instance = this;
|
Instance = this;
|
||||||
|
|
||||||
|
_isFirstTime = exceptionalFirstCycleLength > 0 ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnNetworkSpawn()
|
public override void OnNetworkSpawn()
|
||||||
@@ -83,23 +88,33 @@ namespace Northbound
|
|||||||
|
|
||||||
_currentTime.Value -= Time.deltaTime;
|
_currentTime.Value -= Time.deltaTime;
|
||||||
|
|
||||||
// 중간 지점 체크
|
if (_isFirstTime)
|
||||||
if (!_hasReachedHalfway && _currentTime.Value <= cycleLength / 2f)
|
|
||||||
{
|
{
|
||||||
_hasReachedHalfway = true;
|
if (_currentTime.Value + exceptionalFirstCycleLength < cycleLength)
|
||||||
OnHalfwayPoint?.Invoke(cycleLength / 2f);
|
{
|
||||||
NotifyHalfwayClientRpc();
|
_isFirstTime = false;
|
||||||
|
CompleteCycle();
|
||||||
if (showDebugLogs)
|
}
|
||||||
Debug.Log($"<color=yellow>[GlobalTimer] 사이클 중간 지점 도달</color>");
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
// 사이클 완료
|
|
||||||
if (_currentTime.Value <= 0f)
|
|
||||||
{
|
{
|
||||||
CompleteCycle();
|
// 중간 지점 체크
|
||||||
}
|
if (!_hasReachedHalfway && _currentTime.Value <= cycleLength / 2f)
|
||||||
|
{
|
||||||
|
_hasReachedHalfway = true;
|
||||||
|
OnHalfwayPoint?.Invoke(cycleLength / 2f);
|
||||||
|
NotifyHalfwayClientRpc();
|
||||||
|
|
||||||
|
if (showDebugLogs)
|
||||||
|
Debug.Log($"<color=yellow>[GlobalTimer] 사이클 중간 지점 도달</color>");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 사이클 완료
|
||||||
|
if (_currentTime.Value <= 0f)
|
||||||
|
{
|
||||||
|
CompleteCycle();
|
||||||
|
}
|
||||||
|
}
|
||||||
OnTimerTick?.Invoke(_currentTime.Value);
|
OnTimerTick?.Invoke(_currentTime.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user