정리 중

This commit is contained in:
2026-06-25 17:37:27 +09:00
parent 66485a4f59
commit 7de6e2b398
11 changed files with 236 additions and 39 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 17248e2bc05120241a44ab242798f420
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 112000000
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,130 @@
fileFormatVersion: 2
guid: 5db04a33a65f26046bff20864f807211
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 1
seamlessCubemap: 1
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 2
aniso: 0
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 2
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 100
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -41,6 +41,7 @@ private enum StartState
private StartState state = StartState.Ready; private StartState state = StartState.Ready;
private Coroutine startRoutine; private Coroutine startRoutine;
private bool areRhinosRunning;
private void Start() private void Start()
{ {
@@ -49,15 +50,19 @@ private void Start()
private void Update() private void Update()
{ {
if (state != StartState.WaitingForKeyGrab) if (state == StartState.WaitingForKeyGrab)
return;
if (!waitForKeyGrab)
return;
if (steeringKey != null && steeringKey.IsGrabbed)
{ {
BeginRaftRide(); if (waitForKeyGrab && steeringKey != null && steeringKey.IsGrabbed)
{
BeginRaftRide();
}
return;
}
if (state == StartState.Starting || state == StartState.Riding)
{
SyncRhinosWithSteeringKey();
} }
} }
@@ -78,7 +83,7 @@ private void SetupStartState()
raftHealth.ResetHealth(); raftHealth.ResetHealth();
} }
StopAllRhinos(); SetRhinosRunning(false, true);
if (fairyObject != null) if (fairyObject != null)
{ {
@@ -135,7 +140,7 @@ private IEnumerator StartRaftSmoothly()
raftController.SetSpeedMultiplier(0f); raftController.SetSpeedMultiplier(0f);
raftController.ResumeRaft(); raftController.ResumeRaft();
StartAllRhinos(); SyncRhinosWithSteeringKey(true);
if (showDebugLog) if (showDebugLog)
{ {
@@ -160,6 +165,7 @@ private IEnumerator StartRaftSmoothly()
raftController.SetSpeedMultiplier(1f); raftController.SetSpeedMultiplier(1f);
state = StartState.Riding; state = StartState.Riding;
SyncRhinosWithSteeringKey(true);
if (showDebugLog) if (showDebugLog)
{ {
@@ -179,7 +185,7 @@ public void OnRaftArrived()
raftController.SetSpeedMultiplier(0f); raftController.SetSpeedMultiplier(0f);
} }
StopAllRhinos(); SetRhinosRunning(false, true);
if (showDebugLog) if (showDebugLog)
{ {
@@ -200,7 +206,7 @@ public void OnRaftFailed()
raftController.SetSpeedMultiplier(0f); raftController.SetSpeedMultiplier(0f);
} }
StopAllRhinos(); SetRhinosRunning(false, true);
if (showDebugLog) if (showDebugLog)
{ {
@@ -208,6 +214,36 @@ public void OnRaftFailed()
} }
} }
private void SyncRhinosWithSteeringKey(bool force = false)
{
SetRhinosRunning(ShouldRhinosRunForCurrentInput(), force);
}
private bool ShouldRhinosRunForCurrentInput()
{
if (!waitForKeyGrab)
return true;
return steeringKey != null && steeringKey.IsGrabbed;
}
private void SetRhinosRunning(bool shouldRun, bool force = false)
{
if (!force && areRhinosRunning == shouldRun)
return;
if (shouldRun)
{
StartAllRhinos();
}
else
{
StopAllRhinos();
}
areRhinosRunning = shouldRun;
}
private void StartAllRhinos() private void StartAllRhinos()
{ {
if (rhinos == null) if (rhinos == null)

View File

@@ -33,6 +33,8 @@ public class RhinoObstacle : MonoBehaviour
[SerializeField] private bool startAutomatically = true; [SerializeField] private bool startAutomatically = true;
[SerializeField] private bool loop = true; [SerializeField] private bool loop = true;
[SerializeField] private bool showDebugLog = true; [SerializeField] private bool showDebugLog = true;
[SerializeField] private bool showLifecycleDebugLog = false;
[SerializeField] private bool showRoutineDebugLog = false;
private Coroutine routine; private Coroutine routine;
private bool isRunning; private bool isRunning;
@@ -82,19 +84,25 @@ private void ResolveReferences()
public void StartRhino() public void StartRhino()
{ {
if (isRunning && routine != null)
return;
if (routine != null) if (routine != null)
{ {
StopCoroutine(routine); StopCoroutine(routine);
routine = null;
} }
isRunning = true; isRunning = true;
routine = StartCoroutine(RhinoRoutine()); routine = StartCoroutine(RhinoRoutine());
Log("시작"); Log("Start");
} }
public void StopRhino() public void StopRhino()
{ {
bool wasActive = isRunning || routine != null || isSurfaced;
isRunning = false; isRunning = false;
if (routine != null) if (routine != null)
@@ -107,7 +115,10 @@ public void StopRhino()
ForceIdleAnimation(); ForceIdleAnimation();
MoveImmediatelyToUnderwater(); MoveImmediatelyToUnderwater();
Log("정지"); if (wasActive)
{
Log("Stop");
}
} }
private IEnumerator RhinoRoutine() private IEnumerator RhinoRoutine()
@@ -120,7 +131,7 @@ private IEnumerator RhinoRoutine()
ForceIdleAnimation(); ForceIdleAnimation();
float hiddenWait = Random.Range(minHiddenTime, maxHiddenTime); float hiddenWait = Random.Range(minHiddenTime, maxHiddenTime);
Log($"물속 대기 {hiddenWait:0.0}초"); LogRoutine($"물속 대기 {hiddenWait:0.0}초");
yield return new WaitForSeconds(hiddenWait); yield return new WaitForSeconds(hiddenWait);
@@ -128,7 +139,7 @@ private IEnumerator RhinoRoutine()
break; break;
// 2. 수면 위로 떠오름 // 2. 수면 위로 떠오름
Log("떠오름 시작"); LogRoutine("떠오름 시작");
yield return MoveToSurface(); yield return MoveToSurface();
if (!isRunning) if (!isRunning)
@@ -139,7 +150,7 @@ private IEnumerator RhinoRoutine()
SetDamageActive(true); SetDamageActive(true);
ForceIdleAnimation(); ForceIdleAnimation();
Log("수면 위 도착 / 데미지 콜라이더 ON"); LogRoutine("수면 위 도착 / 데미지 콜라이더 ON");
yield return new WaitForSeconds(surfaceIdleTime); yield return new WaitForSeconds(surfaceIdleTime);
@@ -147,13 +158,13 @@ private IEnumerator RhinoRoutine()
break; break;
// 4. 공격 실행 // 4. 공격 실행
Log("공격 시작"); LogRoutine("공격 시작");
PlayHitAnimation(); PlayHitAnimation();
yield return new WaitForSeconds(attackStayTime); yield return new WaitForSeconds(attackStayTime);
// 5. 공격 종료 후 Idle 복귀 // 5. 공격 종료 후 Idle 복귀
Log("공격 종료 / Idle 복귀"); LogRoutine("공격 종료 / Idle 복귀");
ForceIdleAnimation(); ForceIdleAnimation();
if (!isRunning) if (!isRunning)
@@ -163,7 +174,7 @@ private IEnumerator RhinoRoutine()
isSurfaced = false; isSurfaced = false;
SetDamageActive(false); SetDamageActive(false);
Log("잠수 시작 / 데미지 콜라이더 OFF"); LogRoutine("잠수 시작 / 데미지 콜라이더 OFF");
yield return MoveToUnderwater(); yield return MoveToUnderwater();
if (!loop) if (!loop)
@@ -228,7 +239,7 @@ private IEnumerator MoveToUnderwater()
SetDamageActive(false); SetDamageActive(false);
ForceIdleAnimation(); ForceIdleAnimation();
Log("잠수 완료"); LogRoutine("잠수 완료");
} }
private void PlayHitAnimation() private void PlayHitAnimation()
@@ -298,7 +309,13 @@ private float Smooth01(float t)
private void Log(string message) private void Log(string message)
{ {
if (showDebugLog) if (showDebugLog && showLifecycleDebugLog)
Debug.Log($"[RhinoObstacle] {name} / {message}");
}
private void LogRoutine(string message)
{
if (showDebugLog && showRoutineDebugLog)
Debug.Log($"[RhinoObstacle] {name} / {message}"); Debug.Log($"[RhinoObstacle] {name} / {message}");
} }

View File

@@ -51,8 +51,8 @@ MonoBehaviour:
serializedVersion: 2 serializedVersion: 2
x: 222 x: 222
y: 76 y: 76
width: 1519 width: 1531
height: 809 height: 840
m_GraphElementMetaData: m_GraphElementMetaData:
- m_Guid: - m_Guid:
m_Value0: 14845512388065122572 m_Value0: 14845512388065122572
@@ -387,7 +387,7 @@ MonoBehaviour:
serializedVersion: 2 serializedVersion: 2
Hash: 445bb420bcd194d5ee0506886951aec8 Hash: 445bb420bcd194d5ee0506886951aec8
m_Version: 2 m_Version: 2
m_Position: {x: 1402.0514, y: 500.70782} m_Position: {x: 1413.954, y: 532.4479}
m_Title: DialogLineNode m_Title: DialogLineNode
m_Tooltip: m_Tooltip:
m_NodePreviewModel: m_NodePreviewModel:
@@ -544,11 +544,11 @@ MonoBehaviour:
- rid: 8414246349295583493 - rid: 8414246349295583493
type: {class: 'Constant`1[[System.String, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor} type: {class: 'Constant`1[[System.String, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
data: data:
m_Value: '{SpaceSceneCode1}' m_Value: 1
- rid: 8414246349295583494 - rid: 8414246349295583494
type: {class: 'Constant`1[[System.String, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor} type: {class: 'Constant`1[[System.String, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
data: data:
m_Value: '{SpaceSceneCode2}' m_Value: 2
- rid: 8414246349295583495 - rid: 8414246349295583495
type: {class: DialogLineNode, ns: WhaleAdventure.Dialog.GraphTool.Editor, asm: Assembly-CSharp-Editor} type: {class: DialogLineNode, ns: WhaleAdventure.Dialog.GraphTool.Editor, asm: Assembly-CSharp-Editor}
data: data:
@@ -584,7 +584,7 @@ MonoBehaviour:
- rid: 8414246349295583503 - rid: 8414246349295583503
type: {class: 'Constant`1[[System.Boolean, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor} type: {class: 'Constant`1[[System.Boolean, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
data: data:
m_Value: 0 m_Value: 1
- rid: 8414246349295583504 - rid: 8414246349295583504
type: {class: 'Constant`1[[System.Boolean, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor} type: {class: 'Constant`1[[System.Boolean, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
data: data:
@@ -592,7 +592,7 @@ MonoBehaviour:
- rid: 8414246349295583505 - rid: 8414246349295583505
type: {class: 'Constant`1[[System.String, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor} type: {class: 'Constant`1[[System.String, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
data: data:
m_Value: OpenDoor m_Value: OpenDoor2
- rid: 8414246349295583506 - rid: 8414246349295583506
type: {class: DialogLineNode, ns: WhaleAdventure.Dialog.GraphTool.Editor, asm: Assembly-CSharp-Editor} type: {class: DialogLineNode, ns: WhaleAdventure.Dialog.GraphTool.Editor, asm: Assembly-CSharp-Editor}
data: data:
@@ -628,7 +628,7 @@ MonoBehaviour:
- rid: 8414246349295583514 - rid: 8414246349295583514
type: {class: 'Constant`1[[System.Boolean, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor} type: {class: 'Constant`1[[System.Boolean, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
data: data:
m_Value: 0 m_Value: 1
- rid: 8414246349295583515 - rid: 8414246349295583515
type: {class: 'Constant`1[[System.Boolean, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor} type: {class: 'Constant`1[[System.Boolean, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
data: data:
@@ -636,7 +636,7 @@ MonoBehaviour:
- rid: 8414246349295583516 - rid: 8414246349295583516
type: {class: 'Constant`1[[System.String, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor} type: {class: 'Constant`1[[System.String, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
data: data:
m_Value: OpenDoor m_Value: OpenDoor1
- rid: 8414246349295583517 - rid: 8414246349295583517
type: {class: DialogLineNode, ns: WhaleAdventure.Dialog.GraphTool.Editor, asm: Assembly-CSharp-Editor} type: {class: DialogLineNode, ns: WhaleAdventure.Dialog.GraphTool.Editor, asm: Assembly-CSharp-Editor}
data: data:

View File

@@ -50,7 +50,7 @@ MonoBehaviour:
x: 222 x: 222
y: 76 y: 76
width: 1337 width: 1337
height: 340 height: 385
m_GraphElementMetaData: m_GraphElementMetaData:
- m_Guid: - m_Guid:
m_Value0: 14845512388065122572 m_Value0: 14845512388065122572
@@ -499,7 +499,7 @@ MonoBehaviour:
- rid: 8414246349295583394 - rid: 8414246349295583394
type: {class: 'Constant`1[[System.Boolean, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor} type: {class: 'Constant`1[[System.Boolean, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
data: data:
m_Value: 0 m_Value: 1
- rid: 8414246349295583395 - rid: 8414246349295583395
type: {class: DialogLineNode, ns: WhaleAdventure.Dialog.GraphTool.Editor, asm: Assembly-CSharp-Editor} type: {class: DialogLineNode, ns: WhaleAdventure.Dialog.GraphTool.Editor, asm: Assembly-CSharp-Editor}
data: data:

Binary file not shown.