Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions 320UnityProject/Assets/PlayerControls.inputactions
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "SkipDialogue",
"type": "Button",
"id": "9f5a6bc6-b65e-4138-9baf-df6c33d92a29",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"initialStateCheck": false
}
],
"bindings": [
Expand Down Expand Up @@ -225,6 +234,17 @@
"action": "OpenMenu",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "230d6cab-cadf-4cc1-b323-5b9df57bc135",
"path": "<Keyboard>/m",
"interactions": "",
"processors": "",
"groups": "",
"action": "SkipDialogue",
"isComposite": false,
"isPartOfComposite": false
}
]
}
Expand Down
16 changes: 16 additions & 0 deletions 320UnityProject/Assets/Prefabs/Player.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,22 @@ MonoBehaviour:
m_Calls: []
m_ActionId: 5bc33532-1f30-4d60-aca1-2bdf91760489
m_ActionName: 'Gameplay/OpenMenu[/Keyboard/escape]'
- m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 7956713884062744753}
m_TargetAssemblyTypeName: Player, Assembly-CSharp
m_MethodName: OnSkipDialogue
m_Mode: 0
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
m_ActionId: 9f5a6bc6-b65e-4138-9baf-df6c33d92a29
m_ActionName: 'Gameplay/SkipDialogue[/Keyboard/m]'
m_NeverAutoSwitchControlSchemes: 0
m_DefaultControlScheme:
m_DefaultActionMap: Gameplay
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ MonoBehaviour:
lines: []
gameManager: {fileID: 0}
alreadySeen: -1
pathChoice: -1
playerScript: {fileID: 0}
infoPanel: {fileID: 0}
--- !u!114 &64336018 stripped
Expand Down Expand Up @@ -7509,7 +7510,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 2783402992089816728, guid: 75815bf93aa5bc349b917dff8f9f5c04, type: 3}
propertyPath: m_LocalScale.x
value: 10.9236
value: 11.9236
objectReference: {fileID: 0}
- target: {fileID: 2783402992089816728, guid: 75815bf93aa5bc349b917dff8f9f5c04, type: 3}
propertyPath: m_LocalScale.y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7571,6 +7571,18 @@ MonoBehaviour:
onInteract:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1373018627}
m_TargetAssemblyTypeName: FrogVilleSceneController, Assembly-CSharp
m_MethodName: UnlockDoors
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument: 0autopsy
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 8051805830699530867}
m_TargetAssemblyTypeName: DialogueDisplay, Assembly-CSharp
m_MethodName: ChoosePathString
Expand All @@ -7580,7 +7592,7 @@ MonoBehaviour:
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument: autopsy
m_StringArgument: 0autopsy
m_BoolArgument: 0
m_CallState: 2
isEndpointEvent: 0
Expand Down Expand Up @@ -8057,7 +8069,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 7914486489613220404, guid: e659517771621ea4090f875b75a80dbe, type: 3}
propertyPath: lockedEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_StringArgument
value: n1locked
value: locked
objectReference: {fileID: 0}
- target: {fileID: 7914486489613220404, guid: e659517771621ea4090f875b75a80dbe, type: 3}
propertyPath: lockedEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
Expand Down Expand Up @@ -24498,7 +24510,9 @@ MonoBehaviour:
choiceParentPrefab: {fileID: 4045703632978157169, guid: 2ff43316bce107744b16a302560809d6, type: 3}
eventSystem: {fileID: 8051805830699530865}
fogWar: {fileID: 1351261697}
autopsyScript: {fileID: 4900000, guid: 8a8d0b20cb235094e92e95810b84e855, type: 3}
letterScript: {fileID: 4900000, guid: f1663b04fbd74a64bb7738cfba602f9f, type: 3}
autopsyObject: {fileID: 405296139}
villageDoors:
- {fileID: 422474220}
- {fileID: 2131623558}
Expand Down Expand Up @@ -35781,7 +35795,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 7914486489613220404, guid: e659517771621ea4090f875b75a80dbe, type: 3}
propertyPath: lockedEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_StringArgument
value: n1locked
value: locked
objectReference: {fileID: 0}
- target: {fileID: 7914486489613220404, guid: e659517771621ea4090f875b75a80dbe, type: 3}
propertyPath: lockedEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
Expand Down Expand Up @@ -39197,7 +39211,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 7914486489613220404, guid: e659517771621ea4090f875b75a80dbe, type: 3}
propertyPath: lockedEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_StringArgument
value: n1locked
value: locked
objectReference: {fileID: 0}
- target: {fileID: 7914486489613220404, guid: e659517771621ea4090f875b75a80dbe, type: 3}
propertyPath: lockedEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,34 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9016890536702456913, guid: 6790864b4f1ae054ca9f45a664bb8d02, type: 3}
propertyPath: onStart
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9016890536702456913, guid: 6790864b4f1ae054ca9f45a664bb8d02, type: 3}
propertyPath: inkScript
value:
objectReference: {fileID: 4900000, guid: 5c807ef23a7ee144b820dc163a1dc041, type: 3}
- target: {fileID: 9016890536702456913, guid: 6790864b4f1ae054ca9f45a664bb8d02, type: 3}
propertyPath: choicePrefab
value:
objectReference: {fileID: 3856283038282802624, guid: 677ba264c0e591f46822e829268723f2, type: 3}
- target: {fileID: 9016890536702456913, guid: 6790864b4f1ae054ca9f45a664bb8d02, type: 3}
propertyPath: speakerSprite
value:
objectReference: {fileID: 21300000, guid: 3c60a14a6931c1d4e9e7aaa94dc2cadd, type: 3}
- target: {fileID: 9016890536702456913, guid: 6790864b4f1ae054ca9f45a664bb8d02, type: 3}
propertyPath: noSpeakerSprite
value:
objectReference: {fileID: 21300000, guid: 4783cd083fe4bda4fbfdb3d26bf2fa17, type: 3}
- target: {fileID: 9016890536702456913, guid: 6790864b4f1ae054ca9f45a664bb8d02, type: 3}
propertyPath: lines.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9016890536702456913, guid: 6790864b4f1ae054ca9f45a664bb8d02, type: 3}
propertyPath: 'lines.Array.data[0]'
value:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
Expand Down Expand Up @@ -3692,6 +3720,8 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
dialogueUIPrefab: {fileID: 4093843948648021414, guid: 25357f13f39a025438a8bcba440e103b, type: 3}
infoPannelPrefab: {fileID: 6645276890318459487, guid: 51b4f4206bcc56c49a44f5ce7b98b561, type: 3}
choiceParentPrefab: {fileID: 4045703632978157169, guid: 2ff43316bce107744b16a302560809d6, type: 3}
playerSpawnPoint: {fileID: 1404071137}
eventSystem: {fileID: 350973807}
--- !u!4 &2146469893
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3963,10 +3963,11 @@ MonoBehaviour:
onEnd:
m_PersistentCalls:
m_Calls: []
inkScript: {fileID: 0}
inkScript: {fileID: 4900000, guid: aa174c61e7007c649a4432f3e80f2f22, type: 3}
lines: []
gameManager: {fileID: 0}
alreadySeen: -1
pathChoice: -1
playerScript: {fileID: 0}
infoPanel: {fileID: 0}
--- !u!1660057539 &9223372036854775807
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,8 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
dialogueUIPrefab: {fileID: 4093843948648021414, guid: 25357f13f39a025438a8bcba440e103b, type: 3}
infoPannelPrefab: {fileID: 6645276890318459487, guid: 51b4f4206bcc56c49a44f5ce7b98b561, type: 3}
choiceParentPrefab: {fileID: 4045703632978157169, guid: 2ff43316bce107744b16a302560809d6, type: 3}
playerSpawnPoint: {fileID: 1231128527}
eventSystem: {fileID: 1647768956}
--- !u!4 &469519506
Expand Down Expand Up @@ -2847,19 +2849,57 @@ PrefabInstance:
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 4505061064924364444, guid: e017ab7d4685dd549af610bcc5c53c20, type: 3}
insertIndex: 3
addedObject: {fileID: 1647768958}
m_SourcePrefab: {fileID: 100100000, guid: e017ab7d4685dd549af610bcc5c53c20, type: 3}
--- !u!114 &1647768956 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 6511680066849145292, guid: e017ab7d4685dd549af610bcc5c53c20, type: 3}
m_PrefabInstance: {fileID: 1647768955}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_GameObject: {fileID: 1647768957}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1647768957 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4505061064924364444, guid: e017ab7d4685dd549af610bcc5c53c20, type: 3}
m_PrefabInstance: {fileID: 1647768955}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1647768958
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1647768957}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 662c9669254b92140b6ffec2e5ec6198, type: 3}
m_Name:
m_EditorClassIdentifier:
dialogueBox: {fileID: 0}
speakerBox: {fileID: 0}
speakerSprite: {fileID: 21300000, guid: 3c60a14a6931c1d4e9e7aaa94dc2cadd, type: 3}
noSpeakerSprite: {fileID: 21300000, guid: 4783cd083fe4bda4fbfdb3d26bf2fa17, type: 3}
choiceParent: {fileID: 0}
choicePrefab: {fileID: 3856283038282802624, guid: 677ba264c0e591f46822e829268723f2, type: 3}
onStart: 0
lockMovement: 1
onEnd:
m_PersistentCalls:
m_Calls: []
inkScript: {fileID: 4900000, guid: 677aa31123d1a384ea0b2fcbbfb57373, type: 3}
lines: []
gameManager: {fileID: 0}
alreadySeen: -1
pathChoice: -1
playerScript: {fileID: 0}
infoPanel: {fileID: 0}
--- !u!1 &1668261132
GameObject:
m_ObjectHideFlags: 0
Expand Down
34 changes: 30 additions & 4 deletions 320UnityProject/Assets/Scripts/DialogueDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,28 @@ public void NextLine(InputAction.CallbackContext context)
NextLine();
}

void NextLine()
public void SkipDialogue(InputAction.CallbackContext context)
{
if (!dialoguePanel.activeSelf || inkStory.currentChoices.Count > 0)
return;

inkStory.ContinueMaximally();
string line = null;
if (inkStory.currentChoices.Count > 0)
line = inkStory.currentText;
NextLine(line);
}

void NextLine(string lineText = null)
{
if (seeing >= 0 && alreadySeen >= seeing)
{
dialoguePanel.SetActive(false);
return;
}
string line = "-1";
if (lineText != null)
line = lineText;
//Debug.Log("seeing: " + seeing);
if (seeing < 0)
{
Expand Down Expand Up @@ -335,9 +349,21 @@ public void ChoosePathString(string path)
for (int i = choiceParent.childCount - 1; i >= 0; i--)
Destroy(choiceParent.GetChild(i).gameObject);
inkStory.ChoosePathString(path);
if (pathChoice >= 0 && inkStory.currentChoices.Count > 0)
inkStory.ChooseChoiceIndex(pathChoice);
NextLine();

string line = null;
if (pathChoice >= 0)
{
if (inkStory.canContinue)
line = inkStory.Continue();
if (line == "0\n")
{
line = null;
inkStory.ContinueMaximally();
inkStory.ChooseChoiceIndex(pathChoice);
}
}

NextLine(line);
}

public void InfoSetup(GameObject infoPanelInstance)
Expand Down
7 changes: 7 additions & 0 deletions 320UnityProject/Assets/Scripts/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,13 @@ public void OnNextLine(InputAction.CallbackContext context)
dialogueDisplay.NextLine(context);
}

public void OnSkipDialogue(InputAction.CallbackContext context)
{
if (!dialogueDisplay)
return;
dialogueDisplay.SkipDialogue(context);
}

public void OnSetRun(InputAction.CallbackContext context)
{
if(context.started || context.performed)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ public class FrogVilleSceneController : MonoBehaviour
[SerializeField] private csFogWar fogWar;

private const int autopsyValue = 0;
[SerializeField] private TextAsset autopsyScript;
private const int letterValue = 1;
[SerializeField] private TextAsset letterScript;
[SerializeField] private interactableObject autopsyObject;
[SerializeField] private SceneWarpTrigger[] villageDoors;

private void Awake()
Expand Down Expand Up @@ -112,16 +114,25 @@ private void Awake()
playerInstance.transform.GetChild(0).GetComponent<interactArea>().dialogueDisplay = dpDisplay;

// Check if doors need to be locked
if (gameManager.ContainsDialogue(dpDisplay.inkScript) < autopsyValue)
if (gameManager.ContainsDialogue(autopsyScript) < autopsyValue)
{
foreach (SceneWarpTrigger door in villageDoors)
door.locked = true;
}

if (gameManager.ContainsDialogue(letterScript) < letterValue)
{
dpDisplay.pathChoice = 0;
//autopsyObject.isDialogue = false;
autopsyObject.dialogue = "The trash can is full";
autopsyObject.isEvent = false;
}
else
{
dpDisplay.pathChoice = 1;
autopsyObject.isDialogue = true;
autopsyObject.isEvent = true;
}
}

interactArea.playerScript = playerInstance.GetComponent<Player>();
Expand All @@ -139,4 +150,13 @@ private void Start()
playerInstance.GetComponent<Player>().rotateControls = false;
}

public void UnlockDoors()
{
if (gameManager.ContainsDialogue(autopsyScript) >= autopsyValue)
return;

foreach (SceneWarpTrigger door in villageDoors)
door.locked = false;
eventSystem.GetComponent<DialogueDisplay>().pathChoice = -1;
}
}
Loading
Loading