Skip to content

Commit

Permalink
Merge pull request #785 from GG-Studio-990001/SLG_연출중입장불가처리
Browse files Browse the repository at this point in the history
Fix : CusScene ISSUE (seperate Cutscene Start, End Func)
  • Loading branch information
jeongopo authored Nov 24, 2024
2 parents a48a36e + 8ba4f5e commit 794fcb2
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ private void Awake()
// CutScene / Mamago
_runner.AddCommandHandler("RebuildBridge", _cutScene.RebuildBridge);
_runner.AddCommandHandler("BuildCompany", _cutScene.BuildCompany);
_runner.AddCommandHandler("EndMamagoCutScene", _cutScene.EndMamagoCutScene);
_runner.AddCommandHandler("EndSLGMode", _cutScene.EndSLGMode);
_runner.AddCommandHandler("ConstructSFX", _cutScene.ConstructSFX);
_runner.AddCommandHandler("CompleteSFX", _cutScene.CompleteSFX);
_runner.AddCommandHandler("MamagoJump", _cutScene.MamagoJump);
_runner.AddCommandHandler("MamagoMove1", _cutScene.MamagoMove1);
Expand Down
20 changes: 16 additions & 4 deletions Assets/Scripts/Runtime/CH1/Main/Dialogue/CutSceneDialogue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Runtime.CH1.Main.Npc;
using Yarn.Unity;
using System.Collections;
using SLGDefines;

namespace Runtime.CH1.Main.Dialogue
{
Expand Down Expand Up @@ -186,24 +187,30 @@ public void SetR2MonPosition()

public void RebuildBridge()
{
Managers.Sound.Play(Sound.SFX, "CH1/Mamago_Construction_SFX");
SLGActionComponent slgAction = FindObjectOfType<SLGActionComponent>();
if (slgAction != null)
{
slgAction.MoveOnNextBuildingState(SLGDefines.SLGBuildingType.Bridge);
slgAction.MoveOnNextBuildingState(SLGBuildingType.Bridge, SLGBuildingProgress.EndCutScene);
}
}

public void BuildCompany()
{
Managers.Sound.Play(Sound.SFX, "CH1/Mamago_Construction_SFX");
SLGActionComponent slgAction = FindObjectOfType<SLGActionComponent>();
if (slgAction != null)
{
slgAction.MoveOnNextBuildingState(SLGDefines.SLGBuildingType.MamagoCompany);
slgAction.MoveOnNextBuildingState(SLGBuildingType.MamagoCompany, SLGBuildingProgress.PlayCutScene);
}
}

public void EndMamagoCutScene()
{
SLGActionComponent slgAction = FindObjectOfType<SLGActionComponent>();
if (slgAction != null)
{
slgAction.MoveOnNextBuildingState(SLGBuildingType.MamagoCompany, SLGBuildingProgress.EndCutScene);
}
}

public void EndSLGMode()
{
Expand All @@ -220,6 +227,11 @@ public void ActiveMamagoBubble()
_mamagoBubble.SetActive(true);
}

public void ConstructSFX()
{
Managers.Sound.Play(Sound.SFX, "CH1/Mamago_Construction_SFX");
}

public void CompleteSFX()
{
Managers.Sound.Play(Sound.SFX, "CH1/Mamago_Complete_SFX");
Expand Down
25 changes: 17 additions & 8 deletions Assets/Scripts/Runtime/CH1/SubB/SLG/SLGActionComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public enum SLGBuildingProgress
BeforeConstruct,
Constructing, //Can Acceleate
PlayCutScene,
EndCutScene,
EndConstruct
}

Expand Down Expand Up @@ -160,7 +161,7 @@ private void Update()
if (RemainedTimeSec < 1)
{
//연출이 나와야 할듯?
MoveOnNextBuildingState(_building.GetBuildingData().GetBuildingType());
MoveOnNextBuildingState(_building.GetBuildingData().GetBuildingType(), SLGBuildingProgress.PlayCutScene);
}
}
}
Expand Down Expand Up @@ -238,7 +239,7 @@ private void InitMap()
}
}

public void MoveOnNextBuildingState(SLGBuildingType InType)
public void MoveOnNextBuildingState(SLGBuildingType InType, SLGBuildingProgress InProgress)
{
if (_SLGBuildingObjects.Length < (int)InType)
{
Expand All @@ -250,10 +251,14 @@ public void MoveOnNextBuildingState(SLGBuildingType InType)
{
return;
}
SLGBuildingProgress _nextProgress = _targetBuilding.GetProgress() +1;
_targetBuilding.ChangeBuildingState(_nextProgress);
if (_targetBuilding.GetProgress() == InProgress)
{
return;
}

switch (_nextProgress)
_targetBuilding.ChangeBuildingState(InProgress);

switch (InProgress)
{
case SLGBuildingProgress.BeforeConstruct:
break;
Expand All @@ -268,6 +273,8 @@ public void MoveOnNextBuildingState(SLGBuildingType InType)
}
PlayCutScene(InType);
break;
case SLGBuildingProgress.EndCutScene:
break;
case SLGBuildingProgress.EndConstruct:
EndConstruction(InType);
break;
Expand Down Expand Up @@ -320,7 +327,7 @@ public void RefreshBuildingObjects()
{
bool _mamagoConstructed = _mamagoBuilding.GetProgress() >= SLGBuildingProgress.EndConstruct;
SLGConstructionInteractionObject.SetActive(IsInSLGMode() && _mamagoConstructed == false);
SLGMaMagoGateColider.SetActive(_mamagoBuilding.GetProgress() > SLGBuildingProgress.PlayCutScene);
SLGMaMagoGateColider.SetActive(_mamagoBuilding.GetProgress() > SLGBuildingProgress.EndCutScene);

if (_mamagoBuilding.GetBuildingData().GetFieldObject() != null)
{
Expand All @@ -334,9 +341,10 @@ public void RefreshBuildingObjects()
_subObjectSwitcher.SetActiveSubObject(0);
break;
case SLGBuildingProgress.Constructing:
case SLGBuildingProgress.PlayCutScene:
_subObjectSwitcher.SetActiveSubObject(1);
break;
case SLGBuildingProgress.PlayCutScene:
case SLGBuildingProgress.EndCutScene:
case SLGBuildingProgress.EndConstruct:
_subObjectSwitcher.SetActiveSubObject(2);
break;
Expand Down Expand Up @@ -367,10 +375,11 @@ public void RefreshBuildingObjects()
break;
case SLGBuildingProgress.BeforeConstruct:
case SLGBuildingProgress.Constructing:
case SLGBuildingProgress.PlayCutScene:
_subObjectSwitcher.SetActiveSubObject(1);
break;
case SLGBuildingProgress.EndConstruct:
case SLGBuildingProgress.PlayCutScene:
case SLGBuildingProgress.EndCutScene:
_subObjectSwitcher.SetActiveSubObject(0);
break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ void OnClickConstructButton()
if(_SLGAction.CanConstructBuilding(_currentBuildingType))
{
CloseWindow();
_SLGAction.MoveOnNextBuildingState(_currentBuildingType);
_SLGAction.MoveOnNextBuildingState(_currentBuildingType, SLGBuildingProgress.Constructing);
}
}
}
Expand All @@ -174,7 +174,7 @@ void OnClickAccelerateButton()
if (_SLGAction.CanAccelerateBuilding(_currentBuildingType))
{
CloseWindow();
_SLGAction.MoveOnNextBuildingState(_currentBuildingType);
_SLGAction.PlayCutScene(_currentBuildingType);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions Assets/_CH1/Dialogues/SLG.yarn
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ title: RebuildBridge
---
<<FadeOut>>
<<wait 1>>
<<ConstructSFX>>
<<RebuildBridge>>
<<wait 2>>

Expand Down
6 changes: 3 additions & 3 deletions Assets/_CH1/Dialogues/Scene5.yarn
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ title: S5

<<FadeOut>>
<<wait 1>>
<<BuildCompany>>
<<ConstructSFX>>
<<wait 2>>

<<BuildCompany>>
<<FadeIn>>
<<wait 1>>

Expand All @@ -24,6 +24,6 @@ title: S5
<<MamagoMove2>>
<<wait 1>>
<<MamagoEnter>>

<<EndMamagoCutScene>>
<<SceneEnd>>
===

0 comments on commit 794fcb2

Please sign in to comment.