Browse Source

Add a preliminary settings menu.

master
Cidney Hamilton 7 months ago
parent
commit
b8ca1eead1
  1. 1
      Assets/Prefabs/SceneConfig.asset
  2. 1657
      Assets/Scenes/_Options.unity
  3. 7
      Assets/Scenes/_Options.unity.meta
  4. 222
      Assets/Scenes/_Title.unity
  5. 8
      Assets/Scripts/Dialogue/StoryEvents.cs
  6. 26
      Assets/Scripts/SettingsView.cs
  7. 11
      Assets/Scripts/SettingsView.cs.meta
  8. 7
      Assets/Scripts/StartButton.cs
  9. 3
      ProjectSettings/EditorBuildSettings.asset

1
Assets/Prefabs/SceneConfig.asset

@ -17,3 +17,4 @@ MonoBehaviour:
GameOver: _Title
UserInterface:
- _Dialogue
- _Options

1657
Assets/Scenes/_Options.unity
File diff suppressed because it is too large
View File

7
Assets/Scenes/_Options.unity.meta

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e88fa03733ecbf544bae64ba2dc7a845
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

222
Assets/Scenes/_Title.unity

@ -152,6 +152,7 @@ RectTransform:
m_Children:
- {fileID: 1415322167}
- {fileID: 863493861}
- {fileID: 2106027904}
m_Father: {fileID: 1215126647}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -517,6 +518,84 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!1 &1306845356
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1306845357}
- component: {fileID: 1306845359}
- component: {fileID: 1306845358}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1306845357
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1306845356}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 2106027904}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1306845358
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1306845356}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: 4e505ecc2c829f07cb5010cc92badb89, type: 3}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: OPTIONS
--- !u!222 &1306845359
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1306845356}
m_CullTransparentMesh: 0
--- !u!1 &1415322166
GameObject:
m_ObjectHideFlags: 0
@ -661,3 +740,146 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2106027903
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2106027904}
- component: {fileID: 2106027908}
- component: {fileID: 2106027907}
- component: {fileID: 2106027906}
- component: {fileID: 2106027905}
m_Layer: 5
m_Name: Settings
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2106027904
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2106027903}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1306845357}
m_Father: {fileID: 10667269}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 169, y: -130.1}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2106027905
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2106027903}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e2e37a5362c66a529aad93de22a6cc8a, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &2106027906
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2106027903}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
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: 0.60784316}
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: 2106027907}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2106027905}
m_MethodName: Settings
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 &2106027907
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2106027903}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &2106027908
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2106027903}
m_CullTransparentMesh: 0

8
Assets/Scripts/Dialogue/StoryEvents.cs

@ -15,6 +15,8 @@ namespace Cyborg.Dialogue {
public static event Action OnContinue;
public static event Action OnHide;
public static event Action OnShowSettings;
// Show the Player Character's speech bubble
public static void Speak(string speaker, string speech, List<string> tags) {
// UnityEngine.Debug.Log("Speaking line " + line);
@ -50,5 +52,11 @@ namespace Cyborg.Dialogue {
}
}
public static void ShowSettings() {
if (OnShowSettings != null) {
OnShowSettings();
}
}
}
}

26
Assets/Scripts/SettingsView.cs

@ -0,0 +1,26 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Cyborg.Audio;
using Cyborg.Dialogue;
namespace Cyborg.Clinic {
public class SettingsView : View
{
void OnEnable() {
Hide();
StoryEvents.OnShowSettings += Show;
}
void OnDisable() {
StoryEvents.OnShowSettings -= Hide;
}
public void Back() {
AudioEvents.PlaySound("click");
Hide();
}
}
}

11
Assets/Scripts/SettingsView.cs.meta

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8f44041e43c4e7f458318b147bbd9d4b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

7
Assets/Scripts/StartButton.cs

@ -16,10 +16,9 @@ namespace Cyborg.Clinic {
SceneEvents.ChangeScene("Main");
}
void Update() {
if (Input.GetKeyUp(KeyCode.Space) || Input.GetKeyUp(KeyCode.KeypadEnter)) {
StartGame();
}
public void Settings() {
AudioEvents.PlaySound("click");
StoryEvents.ShowSettings();
}
}

3
ProjectSettings/EditorBuildSettings.asset

@ -14,6 +14,9 @@ EditorBuildSettings:
- enabled: 1
path: Assets/Scenes/_Dialogue.unity
guid: dbc74459c3865cee083818a2cb0be9e6
- enabled: 1
path: Assets/Scenes/_Options.unity
guid: e88fa03733ecbf544bae64ba2dc7a845
- enabled: 1
path: Assets/Scenes/Main.unity
guid: c8ce4db292941a73aae8d0ee4aac29fc

Loading…
Cancel
Save