From e0cdf77daf5df6d30030b142d4fcbec8f0387b4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Cern=C3=BD?= <cernym65@fit.cvut.cz> Date: Wed, 18 Jan 2023 00:54:52 +0100 Subject: [PATCH] dialogue choices --- .../Scripts/Dialogue/DialogueChoiceButton.cs | 17 ++ .../Dialogue/DialogueChoiceButton.cs.meta | 11 + .../Code/Scripts/Dialogue/DialogueManager.cs | 58 +++- .../SZZ/Code/Scripts/Player/PlayerInteract.cs | 106 +++---- .../Code/Scripts/Player/PlayerInteractUI.cs | 33 +- Assets/SZZ/Dialogue/test.ink | 17 +- Assets/SZZ/Dialogue/test.json | 2 +- Assets/SZZ/Level/Scenes/sandbox michal.unity | 5 - .../Prefabs/EventSystem/UI_EventSystem.prefab | 4 +- Assets/SZZ/Prefabs/View.prefab | 44 ++- Assets/SZZ/Settings/InputMap.inputactions | 93 ++---- Assets/SZZ/UI/Prefabs/DialogueChoice.prefab | 283 ++++++++++++++++++ .../SZZ/UI/Prefabs/DialogueChoice.prefab.meta | 7 + .../Bohemian typewriter SDF.asset | 4 +- 14 files changed, 528 insertions(+), 156 deletions(-) create mode 100644 Assets/SZZ/Code/Scripts/Dialogue/DialogueChoiceButton.cs create mode 100644 Assets/SZZ/Code/Scripts/Dialogue/DialogueChoiceButton.cs.meta create mode 100644 Assets/SZZ/UI/Prefabs/DialogueChoice.prefab create mode 100644 Assets/SZZ/UI/Prefabs/DialogueChoice.prefab.meta diff --git a/Assets/SZZ/Code/Scripts/Dialogue/DialogueChoiceButton.cs b/Assets/SZZ/Code/Scripts/Dialogue/DialogueChoiceButton.cs new file mode 100644 index 0000000..862fde3 --- /dev/null +++ b/Assets/SZZ/Code/Scripts/Dialogue/DialogueChoiceButton.cs @@ -0,0 +1,17 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class DialogueChoiceButton : MonoBehaviour { + public int index; + + private DialogueManager dialogueManager; + + private void Start() { + dialogueManager = DialogueManager.GetInstance(); + } + + public void OnClick() { + dialogueManager.MakeChoice(index); + } +} diff --git a/Assets/SZZ/Code/Scripts/Dialogue/DialogueChoiceButton.cs.meta b/Assets/SZZ/Code/Scripts/Dialogue/DialogueChoiceButton.cs.meta new file mode 100644 index 0000000..bcfb02b --- /dev/null +++ b/Assets/SZZ/Code/Scripts/Dialogue/DialogueChoiceButton.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 30f374d19b489d94c806fd8bc8e7b97b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/SZZ/Code/Scripts/Dialogue/DialogueManager.cs b/Assets/SZZ/Code/Scripts/Dialogue/DialogueManager.cs index b001f1f..52ed60e 100644 --- a/Assets/SZZ/Code/Scripts/Dialogue/DialogueManager.cs +++ b/Assets/SZZ/Code/Scripts/Dialogue/DialogueManager.cs @@ -4,6 +4,7 @@ using TMPro; using Ink.Runtime; using UnityEngine.InputSystem; +using UnityEngine.EventSystems; public class DialogueManager : MonoBehaviour { [Header("Dialogue UI")] @@ -14,9 +15,15 @@ public class DialogueManager : MonoBehaviour { [SerializeField] private float charactersPerSecond = 200f * 4f / 60f; [SerializeField] private float maxDistance = 7f; + [Header("Choices UI")] + [SerializeField] private GameObject choiceButtonsParent; + [SerializeField] private GameObject choiceButtonPrefab; + [SerializeField] private float xOffset = 300; + private Story currentStory; private Transform source; public bool dialogueIsPlaying { get; private set; } = false; + private GameObject[] choiceButtons = null; private static DialogueManager instance; @@ -41,7 +48,7 @@ private void Start() { var view = View.GetInstance(); - skipAction = view.playerInput.actions["Jump"]; + skipAction = view.playerInput.actions["UI/Submit"]; skipAction.started += ContinueStory; } @@ -67,7 +74,8 @@ public void EnterDialogueMode(TextAsset inkJSON, Transform source) { } private void ContinueStory(InputAction.CallbackContext context) { - ContinueStory(); + if (choiceButtons is null) + ContinueStory(); } public void ContinueStory() { @@ -77,8 +85,12 @@ public void ContinueStory() { } if (currentStory.canContinue) { + ClearChoices(); dialogueText.text = currentStory.Continue(); - storyCoroutine = StartCoroutine(DelayContinue(dialogueText.text.Length / charactersPerSecond)); + if (currentStory.currentChoices.Count != 0) + DisplayChoices(); + else + storyCoroutine = StartCoroutine(DelayContinue(dialogueText.text.Length / charactersPerSecond)); } else ExitDialogueMode(); @@ -88,11 +100,47 @@ public void ExitDialogueMode() { if (!dialogueIsPlaying || exitDialogueCoroutine is not null) return; + ClearChoices(); dialogueText.text = ""; dialoguePanel.SetActive(false); exitDialogueCoroutine = StartCoroutine(DelayExitDialogue()); } + public void MakeChoice(int choiceIndex) { + currentStory.ChooseChoiceIndex(choiceIndex); + ContinueStory(); + } + + private void DisplayChoices() { + List<Choice> currentChoices = currentStory.currentChoices; + + if (currentChoices.Count == 0) + return; + + choiceButtons = new GameObject[currentChoices.Count]; + int i = 0; + foreach (var choice in currentChoices) { + var position = new Vector3(xOffset * (i - currentChoices.Count / 2), 0, 0); + choiceButtons[i] = Instantiate(choiceButtonPrefab, Vector3.zero, Quaternion.identity, choiceButtonsParent.transform); + choiceButtons[i].transform.localPosition = position; + choiceButtons[i].GetComponentInChildren<TextMeshProUGUI>().text = choice.text; + choiceButtons[i].GetComponent<DialogueChoiceButton>().index = i; + i++; + } + + EventSystem.current.SetSelectedGameObject(choiceButtons[0]); + } + + private void ClearChoices() { + if (choiceButtons is null) + return; + + foreach (var choice in choiceButtons) + Destroy(choice); + + choiceButtons = null; + } + private IEnumerator DelayContinue(float delayTime) { yield return new WaitForSeconds(delayTime); @@ -110,4 +158,8 @@ private IEnumerator DelayExitDialogue() { public bool Hearable(Transform from) { return Vector3.Distance(from.position, source.position) <= maxDistance; } + + private void OnApplicationPause(bool pauseStatus) { + // TODO pause continue coroutines, choice buttons + } } diff --git a/Assets/SZZ/Code/Scripts/Player/PlayerInteract.cs b/Assets/SZZ/Code/Scripts/Player/PlayerInteract.cs index 4573f35..8c24d62 100644 --- a/Assets/SZZ/Code/Scripts/Player/PlayerInteract.cs +++ b/Assets/SZZ/Code/Scripts/Player/PlayerInteract.cs @@ -1,11 +1,10 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; - using UnityEngine.UI; +using UnityEngine.UI; using TMPro; -public class PlayerInteract : MonoBehaviour -{ +public class PlayerInteract : MonoBehaviour { public int CheatsAmount; [SerializeField] TMP_Text CheatTxt; @@ -19,7 +18,7 @@ public class PlayerInteract : MonoBehaviour [SerializeField] TMP_Text line; private bool showedFullLine = false; - void Start(){ + void Start() { CheatsAmount = 0; AdviceAmount = 0; AvailableMistakes = 0; @@ -27,89 +26,90 @@ void Start(){ imageContainer.enabled = false; } - void Update(){ + void Update() { if (level.playerLevel == 1) { CheatTxt.text = "Zvednuté taháky: "; if (CheatsAmount > 0) imageContainer.enabled = true; SetImage(CheatsAmount); - if (CheatsAmount >= MAX_CHEATS && !showedFullLine){ + if (CheatsAmount >= MAX_CHEATS && !showedFullLine) { showedFullLine = true; - StartCoroutine(ShowMessage(fullCheats,5)); - } + StartCoroutine(ShowMessage(fullCheats, 5)); } + } else { CheatTxt.text = ""; imageContainer.enabled = false; - } + } } - IEnumerator InteractWait(){ - if(Input.GetKeyDown(KeyCode.E)) + IEnumerator InteractWait() { + if (Input.GetKeyDown(KeyCode.E)) CanInteractE(); - else if(Input.GetKeyDown(KeyCode.F)){ - GetNPCDying();} + else if (Input.GetKeyDown(KeyCode.F)) { + GetNPCDying(); + } yield return new WaitForSeconds(5); } - public bool CanInteractE(){ + public bool CanInteractE() { float interactRange = 1; Collider[] colliderArr = Physics.OverlapSphere(transform.position, interactRange); - foreach (Collider collider in colliderArr){ + foreach (Collider collider in colliderArr) { // UDELAT TO LIP - if((collider.TryGetComponent(out NPCInteractable npc))){ - if(Input.GetKeyDown(KeyCode.E)) npc.Interact(); - Debug.Log("NPC Interactable"); - return true; - } - else if((collider.TryGetComponent(out NPCL2Starter npc2))){ - Debug.Log("L2 starter"); - if(Input.GetKeyDown(KeyCode.E)) npc2.Interact(); - return true; - } - else if((collider.TryGetComponent(out NPCEPAdvice npc3))){ - if(Input.GetKeyDown(KeyCode.E)) npc3.Interact(); - return true; - } - else if((collider.TryGetComponent(out NPCAdela npc4))){ - Debug.Log("ADELA"); - if(Input.GetKeyDown(KeyCode.E)) npc4.Interact(); - return true; - } - else if((collider.TryGetComponent(out PagePickupInteraction page))){ - Debug.Log("PagePickupInteraction"); - if(Input.GetKeyDown(KeyCode.E)) page.Interact(); - return true; - } + if ((collider.TryGetComponent(out NPCInteractable npc))) { + if (Input.GetKeyDown(KeyCode.E)) npc.Interact(); + Debug.Log("NPC Interactable"); + return true; + } + else if ((collider.TryGetComponent(out NPCL2Starter npc2))) { + Debug.Log("L2 starter"); + if (Input.GetKeyDown(KeyCode.E)) npc2.Interact(); + return true; + } + else if ((collider.TryGetComponent(out NPCEPAdvice npc3))) { + if (Input.GetKeyDown(KeyCode.E)) npc3.Interact(); + return true; + } + else if ((collider.TryGetComponent(out NPCAdela npc4))) { + Debug.Log("ADELA"); + if (Input.GetKeyDown(KeyCode.E)) npc4.Interact(); + return true; + } + else if ((collider.TryGetComponent(out PagePickupInteraction page))) { + Debug.Log("PagePickupInteraction"); + if (Input.GetKeyDown(KeyCode.E)) page.Interact(); + return true; + } } return false; } - public NPCDying GetNPCDying(){ + public NPCDying GetNPCDying() { float interactRange = 1; Collider[] colliderArr = Physics.OverlapSphere(transform.position, interactRange); foreach (Collider collider in colliderArr) - if (collider.TryGetComponent(out NPCDying npcdying)){ - if(Input.GetKeyDown(KeyCode.F)) npcdying.Interact(); + if (collider.TryGetComponent(out NPCDying npcdying)) { + if (Input.GetKeyDown(KeyCode.F)) npcdying.Interact(); return npcdying; - } + } return null; } - public void setAvailableMistakes(){ - AvailableMistakes = (int)Mathf.Floor((CheatsAmount + AdviceAmount)/2); + public void setAvailableMistakes() { + AvailableMistakes = (int)Mathf.Floor((CheatsAmount + AdviceAmount) / 2); } - public void SetImage(int index){ - if (images.Length >= index && index > 0){ + public void SetImage(int index) { + if (images.Length >= index && index > 0) { imageContainer.sprite = images[index - 1]; } } - public IEnumerator ShowMessage (string message, float delay) { - line.text = message; - line.enabled = true; - yield return new WaitForSeconds(delay); - line.enabled = false; - } + public IEnumerator ShowMessage(string message, float delay) { + line.text = message; + line.enabled = true; + yield return new WaitForSeconds(delay); + line.enabled = false; + } } diff --git a/Assets/SZZ/Code/Scripts/Player/PlayerInteractUI.cs b/Assets/SZZ/Code/Scripts/Player/PlayerInteractUI.cs index 40475d5..264cb16 100644 --- a/Assets/SZZ/Code/Scripts/Player/PlayerInteractUI.cs +++ b/Assets/SZZ/Code/Scripts/Player/PlayerInteractUI.cs @@ -7,25 +7,30 @@ public class PlayerInteractUI : MonoBehaviour { [SerializeField] private GameObject interactPrompt; [SerializeField] private GameObject payRespectsPrompt; - private bool _showInteractionPrompt = false; - private bool _showPayRespactsPrompt = false; + private bool showInteractionPrompt = false; + private bool showPayRespactsPrompt = false; - private PlayerActionsController _playerActionsController; + private DialogueManager dialogueManager; + private PlayerActionsController playerActionsController; private void Awake() { - _playerActionsController = GetComponent<PlayerActionsController>(); + playerActionsController = GetComponent<PlayerActionsController>(); + } + + private void Start() { + dialogueManager = DialogueManager.GetInstance(); } private void FixedUpdate() { - _showInteractionPrompt = false; - _showPayRespactsPrompt = false; + showInteractionPrompt = false; + showPayRespactsPrompt = false; - if (_playerActionsController.interactionTrigger) - _showInteractionPrompt = true; + if (playerActionsController.interactionTrigger) + showInteractionPrompt = true; else { - var lookedAt = _playerActionsController.ShootInteractionRay(); + var lookedAt = playerActionsController.ShootInteractionRay(); if (lookedAt && lookedAt.CompareTag("Interactable")) - _showInteractionPrompt = true; + showInteractionPrompt = true; } } @@ -44,11 +49,15 @@ private void Update() { } */ - if (_showPayRespactsPrompt) { + if (dialogueManager.dialogueIsPlaying) { + Hide(payRespectsPrompt); + Hide(interactPrompt); + } + else if (showPayRespactsPrompt) { Show(payRespectsPrompt); Hide(interactPrompt); } - else if (_showInteractionPrompt) { + else if (showInteractionPrompt) { Show(interactPrompt); Hide(payRespectsPrompt); } diff --git a/Assets/SZZ/Dialogue/test.ink b/Assets/SZZ/Dialogue/test.ink index df598c9..0914471 100644 --- a/Assets/SZZ/Dialogue/test.ink +++ b/Assets/SZZ/Dialogue/test.ink @@ -1,3 +1,14 @@ -This is a test! -another line lol -cya :) \ No newline at end of file +-> main + +=== main === +Which pokemon do you choose? + + [Charmander] + -> chosen("Charmander") + + [Bulbasaur] + -> chosen("Bulbasaur") + + [Squirtle] + -> chosen("Squirtle") + +=== chosen(pokemon) === +You chose {pokemon}! +-> END diff --git a/Assets/SZZ/Dialogue/test.json b/Assets/SZZ/Dialogue/test.json index ee57d2d..f7cf4c9 100644 --- a/Assets/SZZ/Dialogue/test.json +++ b/Assets/SZZ/Dialogue/test.json @@ -1 +1 @@ -{"inkVersion":20,"root":[["^This is a test!","\n","^another line lol","\n","^cya :)","\n",["done",{"#f":5,"#n":"g-0"}],null],"done",{"#f":1}],"listDefs":{}} \ No newline at end of file +{"inkVersion":20,"root":[[{"->":"main"},["done",{"#f":5,"#n":"g-0"}],null],"done",{"main":[["^Which pokemon do you choose?","\n","ev","str","^Charmander","/str","/ev",{"*":".^.c-0","flg":4},"ev","str","^Bulbasaur","/str","/ev",{"*":".^.c-1","flg":4},"ev","str","^Squirtle","/str","/ev",{"*":".^.c-2","flg":4},{"c-0":["\n","ev","str","^Charmander","/str","/ev",{"->":"chosen"},{"#f":5}],"c-1":["\n","ev","str","^Bulbasaur","/str","/ev",{"->":"chosen"},{"#f":5}],"c-2":["\n","ev","str","^Squirtle","/str","/ev",{"->":"chosen"},{"#f":5}]}],{"#f":1}],"chosen":[{"temp=":"pokemon"},"^You chose ","ev",{"VAR?":"pokemon"},"out","/ev","^!","\n","end",{"#f":1}],"#f":1}],"listDefs":{}} \ No newline at end of file diff --git a/Assets/SZZ/Level/Scenes/sandbox michal.unity b/Assets/SZZ/Level/Scenes/sandbox michal.unity index 5cac97d..d23d4a0 100644 --- a/Assets/SZZ/Level/Scenes/sandbox michal.unity +++ b/Assets/SZZ/Level/Scenes/sandbox michal.unity @@ -1035,11 +1035,6 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 6909880373640339006, guid: 39967ec940f6f104eabe57a2974f7ab0, - type: 3} - propertyPath: m_AdditionalShaderChannelsFlag - value: 25 - objectReference: {fileID: 0} - target: {fileID: 7629961867817803925, guid: 39967ec940f6f104eabe57a2974f7ab0, type: 3} propertyPath: m_LocalPosition.x diff --git a/Assets/SZZ/Mobile/Prefabs/EventSystem/UI_EventSystem.prefab b/Assets/SZZ/Mobile/Prefabs/EventSystem/UI_EventSystem.prefab index 989b897..a26605a 100644 --- a/Assets/SZZ/Mobile/Prefabs/EventSystem/UI_EventSystem.prefab +++ b/Assets/SZZ/Mobile/Prefabs/EventSystem/UI_EventSystem.prefab @@ -70,7 +70,7 @@ MonoBehaviour: type: 3} m_MoveAction: {fileID: -2601201257983761182, guid: 7a465a0d9e0a168469c9e51761952157, type: 3} - m_SubmitAction: {fileID: 2835253668640961448, guid: 7a465a0d9e0a168469c9e51761952157, + m_SubmitAction: {fileID: 2064916234097673511, guid: 7a465a0d9e0a168469c9e51761952157, type: 3} m_CancelAction: {fileID: 5733939394696200086, guid: 7a465a0d9e0a168469c9e51761952157, type: 3} @@ -84,6 +84,6 @@ MonoBehaviour: type: 3} m_TrackedDevicePositionAction: {fileID: 0} m_TrackedDeviceOrientationAction: {fileID: 0} - m_DeselectOnBackgroundClick: 1 + m_DeselectOnBackgroundClick: 0 m_PointerBehavior: 0 m_CursorLockBehavior: 0 diff --git a/Assets/SZZ/Prefabs/View.prefab b/Assets/SZZ/Prefabs/View.prefab index f8059c2..94f0160 100644 --- a/Assets/SZZ/Prefabs/View.prefab +++ b/Assets/SZZ/Prefabs/View.prefab @@ -870,7 +870,8 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: + m_text: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer tempor. + Nullam sit amet magna in magna gravida vehicula. ' m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 6eed2a89ac900a14b939500fdced8c08, type: 2} m_sharedMaterial: {fileID: 3561134238486093195, guid: 6eed2a89ac900a14b939500fdced8c08, @@ -1092,6 +1093,7 @@ RectTransform: m_ConstrainProportionsScale: 1 m_Children: - {fileID: 6909880372489281636} + - {fileID: 6372956564085067266} m_Father: {fileID: 6909880373574815807} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -1989,6 +1991,10 @@ MonoBehaviour: dialogueText: {fileID: 6909880372489281637} charactersPerSecond: 13.333333 maxDistance: 7 + choiceButtonsParent: {fileID: 8328153506481388487} + choiceButtonPrefab: {fileID: 6350007252183978683, guid: b17d98987e75db34cad6c64ba3cd3db4, + type: 3} + xOffset: 300 --- !u!1 &6909880373533192475 GameObject: m_ObjectHideFlags: 0 @@ -2926,6 +2932,42 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &8328153506481388487 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6372956564085067266} + m_Layer: 5 + m_Name: DialogueChoices + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6372956564085067266 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8328153506481388487} + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6909880372860330797} + m_RootOrder: 1 + 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: 0, y: 180} + m_SizeDelta: {x: 200, y: 100} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1001 &1530202875637013627 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/SZZ/Settings/InputMap.inputactions b/Assets/SZZ/Settings/InputMap.inputactions index 78db489..7e7dc27 100644 --- a/Assets/SZZ/Settings/InputMap.inputactions +++ b/Assets/SZZ/Settings/InputMap.inputactions @@ -384,7 +384,7 @@ { "name": "Submit", "type": "Button", - "id": "60141469-6c3f-44ae-b834-21d819248e9d", + "id": "382aaa08-90ec-45d4-a82a-d5f08bb52703", "expectedControlType": "Button", "processors": "", "interactions": "", @@ -465,17 +465,6 @@ "isComposite": false, "isPartOfComposite": false }, - { - "name": "", - "id": "e74a8d69-d003-485b-a421-35957c9b645e", - "path": "<Keyboard>/enter", - "interactions": "", - "processors": "", - "groups": "KeyboardMouse", - "action": "Submit", - "isComposite": false, - "isPartOfComposite": false - }, { "name": "", "id": "7adf63c8-0dc8-4eaa-924e-88610afc21bb", @@ -488,7 +477,7 @@ "isPartOfComposite": false }, { - "name": "WASD", + "name": "ScrollWheel", "id": "4e07aa63-34df-4a9b-ba4d-fc924ac9c619", "path": "2DVector(mode=1)", "interactions": "", @@ -498,32 +487,10 @@ "isComposite": true, "isPartOfComposite": false }, - { - "name": "up", - "id": "bdf35135-196e-4a1d-807e-d0426117beeb", - "path": "<Keyboard>/w", - "interactions": "", - "processors": "", - "groups": "KeyboardMouse", - "action": "Move", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "down", - "id": "c53b114c-acac-4e02-b153-2538f1ab0891", - "path": "<Keyboard>/s", - "interactions": "", - "processors": "", - "groups": "KeyboardMouse", - "action": "Move", - "isComposite": false, - "isPartOfComposite": true - }, { "name": "left", - "id": "b1248f6f-ddf3-410d-b845-5a9fd56a1187", - "path": "<Keyboard>/a", + "id": "bdf35135-196e-4a1d-807e-d0426117beeb", + "path": "<Mouse>/scroll/up", "interactions": "", "processors": "", "groups": "KeyboardMouse", @@ -533,30 +500,8 @@ }, { "name": "right", - "id": "803bbb0c-1198-438a-b534-7046d87b8161", - "path": "<Keyboard>/d", - "interactions": "", - "processors": "", - "groups": "KeyboardMouse", - "action": "Move", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "up", - "id": "b036d217-50a5-431b-9efd-a55143b7bdbb", - "path": "<Keyboard>/upArrow", - "interactions": "", - "processors": "", - "groups": "KeyboardMouse", - "action": "Move", - "isComposite": false, - "isPartOfComposite": true - }, - { - "name": "down", - "id": "a166ef34-5a32-4fa1-b0cf-85b246ac84fa", - "path": "<Keyboard>/downArrow", + "id": "c53b114c-acac-4e02-b153-2538f1ab0891", + "path": "<Mouse>/scroll/down", "interactions": "", "processors": "", "groups": "KeyboardMouse", @@ -565,35 +510,35 @@ "isPartOfComposite": true }, { - "name": "left", - "id": "83fcc4da-ef5f-42ba-b680-19880ddd3dc4", - "path": "<Keyboard>/leftArrow", + "name": "", + "id": "25d17a70-efdc-43d1-8710-8b8ce9681736", + "path": "<Gamepad>/dpad", "interactions": "", "processors": "", - "groups": "KeyboardMouse", + "groups": "Gamepad", "action": "Move", "isComposite": false, - "isPartOfComposite": true + "isPartOfComposite": false }, { - "name": "right", - "id": "36a550cf-7957-4eda-aaba-cb43bc5ece7d", - "path": "<Keyboard>/rightArrow", + "name": "", + "id": "3c8ecb13-8a88-46e1-b91f-01bddf60ca1c", + "path": "<Keyboard>/space", "interactions": "", "processors": "", "groups": "KeyboardMouse", - "action": "Move", + "action": "Submit", "isComposite": false, - "isPartOfComposite": true + "isPartOfComposite": false }, { "name": "", - "id": "25d17a70-efdc-43d1-8710-8b8ce9681736", - "path": "<Gamepad>/dpad", + "id": "70a75f2d-bd53-4c6c-80a8-b0dd338b172b", + "path": "<Gamepad>/buttonSouth", "interactions": "", "processors": "", "groups": "Gamepad", - "action": "Move", + "action": "Submit", "isComposite": false, "isPartOfComposite": false } diff --git a/Assets/SZZ/UI/Prefabs/DialogueChoice.prefab b/Assets/SZZ/UI/Prefabs/DialogueChoice.prefab new file mode 100644 index 0000000..7c152c4 --- /dev/null +++ b/Assets/SZZ/UI/Prefabs/DialogueChoice.prefab @@ -0,0 +1,283 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &6350007251432450940 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6350007251432450941} + - component: {fileID: 6350007251432450943} + - component: {fileID: 6350007251432450942} + m_Layer: 5 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6350007251432450941 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6350007251432450940} + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6350007252183978676} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: 0, y: -50} + m_SizeDelta: {x: 200, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &6350007251432450943 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6350007251432450940} + m_CullTransparentMesh: 1 +--- !u!114 &6350007251432450942 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6350007251432450940} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 6eed2a89ac900a14b939500fdced8c08, type: 2} + m_sharedMaterial: {fileID: 3561134238486093195, guid: 6eed2a89ac900a14b939500fdced8c08, + type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 14 + m_fontSizeBase: 14 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &6350007252183978683 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6350007252183978676} + - component: {fileID: 8651382081887009633} + - component: {fileID: 6350007252183978679} + - component: {fileID: 1146832657287606291} + - component: {fileID: 6350007252183978677} + m_Layer: 5 + m_Name: DialogueChoice + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6350007252183978676 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6350007252183978683} + 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_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 6350007251432450941} + m_Father: {fileID: 0} + m_RootOrder: 0 + 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: 0, y: 0} + m_SizeDelta: {x: 10, y: 10} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &8651382081887009633 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6350007252183978683} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 30f374d19b489d94c806fd8bc8e7b97b, type: 3} + m_Name: + m_EditorClassIdentifier: + index: 0 +--- !u!222 &6350007252183978679 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6350007252183978683} + m_CullTransparentMesh: 1 +--- !u!114 &1146832657287606291 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6350007252183978683} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Texture: {fileID: 10912, guid: 0000000000000000f000000000000000, type: 0} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!114 &6350007252183978677 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6350007252183978683} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 1 + 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: 0} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.9607844, g: 0.9607844, b: 0.9607844, 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.05 + 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: 1146832657287606291} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 8651382081887009633} + m_TargetAssemblyTypeName: DialogueChoiceButton, Assembly-CSharp + m_MethodName: OnClick + 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 diff --git a/Assets/SZZ/UI/Prefabs/DialogueChoice.prefab.meta b/Assets/SZZ/UI/Prefabs/DialogueChoice.prefab.meta new file mode 100644 index 0000000..7816529 --- /dev/null +++ b/Assets/SZZ/UI/Prefabs/DialogueChoice.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b17d98987e75db34cad6c64ba3cd3db4 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TextMesh Pro/Resources/Fonts & Materials/Bohemian typewriter SDF.asset b/Assets/TextMesh Pro/Resources/Fonts & Materials/Bohemian typewriter SDF.asset index ebc6a46..a9cc4a8 100644 --- a/Assets/TextMesh Pro/Resources/Fonts & Materials/Bohemian typewriter SDF.asset +++ b/Assets/TextMesh Pro/Resources/Fonts & Materials/Bohemian typewriter SDF.asset @@ -4897,7 +4897,7 @@ Material: - _FaceUVSpeedX: 0 - _FaceUVSpeedY: 0 - _GlowInner: 0.05 - - _GlowOffset: 0 + - _GlowOffset: 0.182 - _GlowOuter: 0.05 - _GlowPower: 0.75 - _GradientScale: 6 @@ -4926,7 +4926,7 @@ Material: - _TextureHeight: 512 - _TextureWidth: 512 - _UnderlayDilate: 0 - - _UnderlayOffsetX: 0 + - _UnderlayOffsetX: -0.388 - _UnderlayOffsetY: 0 - _UnderlaySoftness: 0 - _VertexOffsetX: 0 -- GitLab