Skip to content

Commit

Permalink
Merge pull request #774 from GG-Studio-990001/755-ch2-비주얼-노벨-기본-기능-구현-1
Browse files Browse the repository at this point in the history
[CH1] 자동 진행 1
  • Loading branch information
wooyn730 authored Nov 17, 2024
2 parents 28d255c + e3a0f29 commit cda1ed7
Show file tree
Hide file tree
Showing 38 changed files with 93 additions and 1,364 deletions.
57 changes: 0 additions & 57 deletions Assets/Prefabs/System/DialogueSystem.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ GameObject:
- component: {fileID: 9209193912961166755}
- component: {fileID: 5768147177176310894}
- component: {fileID: 7031190173570394065}
- component: {fileID: 8593750091250438143}
- component: {fileID: 6515317787496031345}
- component: {fileID: 8989253410039029577}
- component: {fileID: 8055073858314940635}
Expand Down Expand Up @@ -343,62 +342,6 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &8593750091250438143
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4275146950738462450}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 7031190173570394065}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 5709054019036521375}
m_TargetAssemblyTypeName: Yarn.Unity.LineView, Assembly-CSharp
m_MethodName: OnContinueClicked
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &6515317787496031345
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down
40 changes: 35 additions & 5 deletions Assets/Scenes/CH2.unity
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ MonoBehaviour:
_turnController: {fileID: 1755298184}
_locationSelectionUI: {fileID: 444606903}
_lineViewCanvas: {fileID: 1100803384}
_lineView: {fileID: 1100803380}
_nameTag: {fileID: 789604149}
_lineTxt: {fileID: 1441580442}
_characters:
Expand Down Expand Up @@ -1324,6 +1325,11 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 659401537}
m_CullTransparentMesh: 1
--- !u!1 &696121908 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4848254361678375663, guid: 0d61b18444317944a99ee38e37220ff8, type: 3}
m_PrefabInstance: {fileID: 832304771}
m_PrefabAsset: {fileID: 0}
--- !u!1 &696216668
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1662,6 +1668,10 @@ PrefabInstance:
propertyPath: m_Sprite
value:
objectReference: {fileID: 21300000, guid: b64f6b2d324457f4190ca23aee698d3a, type: 3}
- target: {fileID: 4848254361678375663, guid: 0d61b18444317944a99ee38e37220ff8, type: 3}
propertyPath: m_Name
value: SettingBtnImg
objectReference: {fileID: 0}
- target: {fileID: 5025059340301348446, guid: 0d61b18444317944a99ee38e37220ff8, type: 3}
propertyPath: m_Name
value: SettingSystem
Expand All @@ -1682,6 +1692,14 @@ PrefabInstance:
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7607472912886499478, guid: 0d61b18444317944a99ee38e37220ff8, type: 3}
propertyPath: m_AnchoredPosition.x
value: -46.799988
objectReference: {fileID: 0}
- target: {fileID: 7607472912886499478, guid: 0d61b18444317944a99ee38e37220ff8, type: 3}
propertyPath: m_AnchoredPosition.y
value: -43.899994
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects:
- {fileID: 6347440992739952066, guid: 0d61b18444317944a99ee38e37220ff8, type: 3}
Expand Down Expand Up @@ -2395,10 +2413,6 @@ PrefabInstance:
propertyPath: holdTime
value: 2
objectReference: {fileID: 0}
- target: {fileID: 5709054019036521375, guid: 8791e0e7477d6684f830b32feb216504, type: 3}
propertyPath: autoAdvance
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5709054019036521375, guid: 8791e0e7477d6684f830b32feb216504, type: 3}
propertyPath: onCharacterTyped.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
Expand Down Expand Up @@ -3215,6 +3229,7 @@ GameObject:
- component: {fileID: 1749894940}
- component: {fileID: 1749894939}
- component: {fileID: 1749894941}
- component: {fileID: 1749894942}
m_Layer: 5
m_Name: AutoBtn
m_TagString: Untagged
Expand Down Expand Up @@ -3286,7 +3301,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1749894937}
m_Enabled: 0
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
Expand Down Expand Up @@ -3335,6 +3350,19 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &1749894942
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1749894937}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4caf6a91ac77a6747aa1c3320b2c444f, type: 3}
m_Name:
m_EditorClassIdentifier:
_dialogue: {fileID: 304034740}
--- !u!1 &1755298181
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -4227,6 +4255,8 @@ MonoBehaviour:
_uis:
- {fileID: 1484800585}
- {fileID: 1962123606}
- {fileID: 1749894937}
- {fileID: 696121908}
_lineView: {fileID: 1100803380}
_lineTxt: {fileID: 1441580442}
_skipPanel: {fileID: 421610020}
Expand Down
16 changes: 16 additions & 0 deletions Assets/Scripts/Runtime/CH2/AutoBtnController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Runtime.CH2.Dialogue;
using UnityEngine;

namespace Runtime.CH2
{
public class AutoBtnController : MonoBehaviour
{
[SerializeField] private CH2Dialogue _dialogue;

void OnEnable()
{
Debug.Log("일어남");
_dialogue.StartAutoDialogue();
}
}
}
11 changes: 11 additions & 0 deletions Assets/Scripts/Runtime/CH2/AutoBtnController.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 13 additions & 18 deletions Assets/Scripts/Runtime/CH2/Dialogue/CH2Dialogue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class CH2Dialogue : DialogueViewBase
[SerializeField] private LocationTransitionUI _locationSelectionUI;
[Header("=Else=")]
[SerializeField] private CanvasGroup _lineViewCanvas;
[SerializeField] private LineView _lineView;
[SerializeField] private GameObject _nameTag;
[SerializeField] private TextMeshProUGUI _lineTxt;
[SerializeField] private Image[] _characters = new Image[2];
Expand All @@ -35,8 +36,8 @@ public class CH2Dialogue : DialogueViewBase
[SerializeField] private GameObject _toBeContinued;
[SerializeField] private bool _isAutoAdvanced = false;
private string _speaker;
private string _dialogueText;
private int currentMaxVisibleCharacters;
// private string _dialogueText;
// private int currentMaxVisibleCharacters;

private void Awake()
{
Expand Down Expand Up @@ -66,7 +67,6 @@ private void ClearLineText()

public override void RunLine(LocalizedLine dialogueLine, Action onDialogueLineFinished)
{
// SetAuto(onDialogueLineFinished);
_speaker = dialogueLine.CharacterName;
SetNameTag(_speaker != "");

Expand Down Expand Up @@ -164,37 +164,32 @@ private void SetNameTag(bool hasName)
_nameTag.SetActive(hasName);
}

#region Auto Dialgue
public void AutoDialogueToggle()
{
_isAutoAdvanced = !_isAutoAdvanced;
Debug.Log("_isAutoAdvanced: " + _isAutoAdvanced);
}

/*
private void SetAuto(Action onDialogueLineFinished)
public void StartAutoDialogue()
{
Debug.Log("어");
if (_isAutoAdvanced)
{
onDialogueLineFinished += () => StartAutoDialogue();
}
else
{
onDialogueLineFinished -= () => StartAutoDialogue();
StopCoroutine(nameof(AutoDialogue));
StartCoroutine(nameof(AutoDialogue));
Debug.Log("기다료");
}
}
private void StartAutoDialogue()
{
StartCoroutine(nameof(AutoDialogue));

}

IEnumerator AutoDialogue()
{
Debug.Log("기달");
yield return new WaitForSeconds(1f);
Debug.Log("끗");
_runner.Dialogue.Continue();
}*/
_lineView.OnContinueClicked();
}
#endregion

/*
public void SkipDialogue()
Expand Down
22 changes: 9 additions & 13 deletions Assets/Scripts/Runtime/CH2/Main/KeySetting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public class KeySetting : MonoBehaviour
[SerializeField] private DialogueRunner _runner;
[SerializeField] private CH2Dialogue _dialogue;
[SerializeField] private GameObject[] _uis;
// [SerializeField] private CanvasGroup _lineViewCanvas;
[SerializeField] private LineView _lineView;
[SerializeField] private TextMeshProUGUI _lineTxt;
[SerializeField] private GameObject _skipPanel;
Expand Down Expand Up @@ -43,6 +42,15 @@ public void HideUI()
foreach (GameObject ui in _uis)
ui.SetActive(!_isHidingUI);
}

public void AutoDialogue()
{
if (!_runner.IsDialogueRunning)
return;

_dialogue.AutoDialogueToggle();
// 대사를 치고 1초 뒤에 다음 대사로 넘김
}
/*
//TODO: _runner.IsDialogueRunning 말고 직접 다이얼로그 시작과 끝 설정
public void Skip()
Expand All @@ -52,18 +60,6 @@ public void Skip()
_skipPanel.SetActive(true);
}
public void AutoDialogue()
{
//if (!_runner.IsDialogueRunning)
// return;
//_dialogue.AutoDialogueToggle();
// 대화 자동 진행 활성화
// 직접 넘길 수 없음
// 2초 뒤에 다음 대사로 넘김
// 현재 Auto
}
*/
}
}
2 changes: 1 addition & 1 deletion Assets/Scripts/Runtime/Input/InGameKeyBinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ public void CH2KeyBinding(SettingsUIView settingsUIView, KeySetting keySetting)
_gameOverControls.UI.GameSetting.performed += _ => settingsUIView.GameSettingToggle();
_gameOverControls.UI.DialogueInput.performed += _ => keySetting.DialogueInput();
_gameOverControls.UI.Hide.performed += _ => keySetting.HideUI();
_gameOverControls.UI.Auto.performed += _ => keySetting.AutoDialogue();
//_gameOverControls.UI.Skip.performed += _ => keySetting.Skip();
//_gameOverControls.UI.Auto.performed += _ => keySetting.AutoDialogue();
}

// ETC
Expand Down
1 change: 1 addition & 0 deletions Assets/Scripts/Runtime/Manager/DataManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public void NewGame()
{
_gameData = new GameData { Version = Application.version };
SaveGame();
Managers.Sound.ResetPlayTime();
}
}
}
5 changes: 5 additions & 0 deletions Assets/Scripts/Runtime/Manager/SoundManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ private AudioClip GetAudioClip(string path)
return audioClip;
}

public void ResetPlayTime()
{
_bgmPlayTime = 0f;
}

public void StopAllSound()
{
StopBGM();
Expand Down
2 changes: 1 addition & 1 deletion Assets/StreamingAssets/build_info
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Build from WOOS_COM at 2024-11-17 오후 11:26:16
Build from WOOS_COM at 2024-11-18 오전 1:32:02
Binary file removed Assets/_CH2/Arts/UI/Bottom_auto.png
Binary file not shown.
Loading

0 comments on commit cda1ed7

Please sign in to comment.