From dd1b3db4170fcbc54942ff8faa8dd9fc86fbb189 Mon Sep 17 00:00:00 2001 From: Finnchen123 Date: Sat, 7 Jun 2025 12:09:07 +0200 Subject: [PATCH] Reworked controls and fixed equipment generation with Place = Bag --- Assets/Scenes/GameScene.unity | 62 ++++++++++++++++++----- Assets/Scripts/Controls.cs | 1 + Assets/Scripts/Handler/UIHandler.cs | 1 + Assets/Scripts/Items/Equipment.cs | 2 +- Assets/Scripts/Player/PlayerGameObject.cs | 1 - save.json | 4 +- 6 files changed, 54 insertions(+), 17 deletions(-) diff --git a/Assets/Scenes/GameScene.unity b/Assets/Scenes/GameScene.unity index b5034d6..da8bde2 100644 --- a/Assets/Scenes/GameScene.unity +++ b/Assets/Scenes/GameScene.unity @@ -7348,13 +7348,13 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 389433792} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + 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: 24840619} - m_Father: {fileID: 718596642} + m_Father: {fileID: 925710720} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.4, y: 0.15} m_AnchorMax: {x: 0.6, y: 0.25} @@ -12253,13 +12253,13 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 653632097} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + 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: 1156480095} - m_Father: {fileID: 718596642} + m_Father: {fileID: 925710720} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.35, y: 0.35} m_AnchorMax: {x: 0.65, y: 0.6} @@ -13798,10 +13798,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - - {fileID: 1695792616} - - {fileID: 2025004928} - - {fileID: 653632098} - - {fileID: 389433793} + - {fileID: 925710720} m_Father: {fileID: 1456932137} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -18779,6 +18776,45 @@ MonoBehaviour: references: version: 2 RefIds: [] +--- !u!1 &925710719 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 925710720} + m_Layer: 5 + m_Name: Tutorial_Main + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &925710720 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 925710719} + 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: 1695792616} + - {fileID: 2025004928} + - {fileID: 653632098} + - {fileID: 389433793} + m_Father: {fileID: 718596642} + 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!1 &926355124 GameObject: m_ObjectHideFlags: 0 @@ -29952,7 +29988,7 @@ RectTransform: - {fileID: 445308058} m_Father: {fileID: 1456932137} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.875, y: 0.775} + m_AnchorMin: {x: 0.9, y: 0.8} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} @@ -33676,13 +33712,13 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1695792615} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + 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: 1031718409} - m_Father: {fileID: 718596642} + m_Father: {fileID: 925710720} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.65, y: 0.76500005} m_AnchorMax: {x: 0.8, y: 1} @@ -39398,13 +39434,13 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2025004927} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + 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: 1502355731} - m_Father: {fileID: 718596642} + m_Father: {fileID: 925710720} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.2, y: 0.75} m_AnchorMax: {x: 0.35, y: 1} diff --git a/Assets/Scripts/Controls.cs b/Assets/Scripts/Controls.cs index 1990e0c..e10a203 100644 --- a/Assets/Scripts/Controls.cs +++ b/Assets/Scripts/Controls.cs @@ -74,6 +74,7 @@ public class Controls : MonoBehaviour public void FixedUpdate() { + Debug.Log(playerInput.currentControlScheme); if (direction != MoveDirection.None) { AxisEventData data = new AxisEventData(EventSystem.current); diff --git a/Assets/Scripts/Handler/UIHandler.cs b/Assets/Scripts/Handler/UIHandler.cs index 31b1179..6a26575 100644 --- a/Assets/Scripts/Handler/UIHandler.cs +++ b/Assets/Scripts/Handler/UIHandler.cs @@ -190,6 +190,7 @@ namespace Assets.Scripts if (state == UIState.PAUSE) { closePauseMenu(); + Cursor.lockState = CursorLockMode.Locked; } else { diff --git a/Assets/Scripts/Items/Equipment.cs b/Assets/Scripts/Items/Equipment.cs index 1955ef1..f46e476 100644 --- a/Assets/Scripts/Items/Equipment.cs +++ b/Assets/Scripts/Items/Equipment.cs @@ -29,7 +29,7 @@ namespace Assets.Scripts numberOfAttributes = 0; } calculateAttributes(luck, numberOfAttributes); - place = (ItemPlace)rand.Next(8); + place = (ItemPlace)rand.Next(7); editName(); loadImage(); } diff --git a/Assets/Scripts/Player/PlayerGameObject.cs b/Assets/Scripts/Player/PlayerGameObject.cs index ca534c2..4607509 100644 --- a/Assets/Scripts/Player/PlayerGameObject.cs +++ b/Assets/Scripts/Player/PlayerGameObject.cs @@ -183,7 +183,6 @@ namespace Assets.Scripts.Player } public void rotate(Vector2 input, Vector2 speed){ - Debug.Log(input.x * speed.x); transform.Rotate(Vector3.up, input.x * speed.x * 5);// * Time.deltaTime); } diff --git a/save.json b/save.json index 72d94b1..262193a 100644 --- a/save.json +++ b/save.json @@ -18,7 +18,7 @@ "isDodging": "False", "killcount": 0, "treecount": 0, -"orecount": 1, +"orecount": 0, "luck": 20, "difficulty": 0 }, @@ -52,7 +52,7 @@ "slot0": { "bag1": { "rarity": "COMMON", -"itemName": "Tin ore", +"itemName": "Rock", }, "bag2": "empty",