diff --git a/Assets/Resources/Prefabs/Modulok/module2.prefab b/Assets/Resources/Prefabs/Modulok/module2.prefab index 7caac44..a5b7b63 100644 --- a/Assets/Resources/Prefabs/Modulok/module2.prefab +++ b/Assets/Resources/Prefabs/Modulok/module2.prefab @@ -123,14 +123,14 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 499665619135560210} - m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} - m_LocalPosition: {x: 16.96, y: 1, z: 3} + m_LocalRotation: {x: -0.70710677, y: 0, z: 0, w: 0.70710677} + m_LocalPosition: {x: 16.85, y: 1.01, z: 3} m_LocalScale: {x: 3, y: 1.5, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 8769601115213192681} m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: -90, y: 90, z: -90} --- !u!33 &6014928796244115842 MeshFilter: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/EndlessRunnerTest.unity b/Assets/Scenes/EndlessRunnerTest.unity index 2b6d5c5..dd262ef 100644 --- a/Assets/Scenes/EndlessRunnerTest.unity +++ b/Assets/Scenes/EndlessRunnerTest.unity @@ -258,6 +258,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: loadFrom: [] + sideObjects: [] --- !u!4 &1201779183 Transform: m_ObjectHideFlags: 0 @@ -286,8 +287,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: rb: {fileID: 7917514869596290073} - jumpforce: 5 + jumpforce: 350 sideMovement: 3 + isJumping: 0 --- !u!1001 &1265567512 PrefabInstance: m_ObjectHideFlags: 0 @@ -9046,7 +9048,7 @@ GameObject: m_Component: - component: {fileID: 7917514869596290071} - component: {fileID: 7917514869596290073} - - component: {fileID: 7917514869596290072} + - component: {fileID: 7917514869596290074} m_Layer: 0 m_Name: BobyWithRigifyAdvanced m_TagString: Untagged @@ -9726,19 +9728,6 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!65 &7917514869596290072 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7398140401948337837} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 3.46828, y: 6.272723, z: 1.3076319} - m_Center: {x: -0.011764348, y: 3.0974507, z: -0.01770711} --- !u!54 &7917514869596290073 Rigidbody: m_ObjectHideFlags: 0 @@ -9753,8 +9742,22 @@ Rigidbody: m_UseGravity: 1 m_IsKinematic: 0 m_Interpolate: 0 - m_Constraints: 116 - m_CollisionDetection: 1 + m_Constraints: 112 + m_CollisionDetection: 2 +--- !u!136 &7917514869596290074 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7398140401948337837} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 1.7212968 + m_Height: 6.3698125 + m_Direction: 1 + m_Center: {x: -0.03604698, y: 3.18, z: -0.06167984} --- !u!4 &7986884067029569574 Transform: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index a440a84..f483d3e 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -10,7 +10,8 @@ public class PlayerController : MonoBehaviour public float jumpforce = 5f; public float sideMovement = 3f; private Vector3 direction; - private float horizontal, vertical, isJumping; + private float horizontal, vertical; + public bool isJumping; private bool isOnGround; //swipe movement @@ -23,10 +24,16 @@ public class PlayerController : MonoBehaviour void Update(){ //jumping - /*if (isJumping > 0 && isOnGround) { - rb.AddForce(new Vector3(0, jumpforce, 0)); - isOnGround = false; - }*/ + if (Input.touchCount > 0) { + var startPosition = Input.GetTouch(0).position; + if(Input.GetTouch(0).phase == TouchPhase.Ended && !isJumping && Input.GetTouch(0).position == startPosition){ + rb.AddForce(new Vector3(0, jumpforce, 0)); + isJumping = true; + }else if(Input.GetTouch(0).phase == TouchPhase.Ended ){ + isJumping = false; + } + //isOnGround = false; + } //new character controller with swipe lane changing if(Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began){ @@ -35,7 +42,7 @@ public class PlayerController : MonoBehaviour if(Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Ended){ endTouchPosition = Input.GetTouch(0).position; - if(endTouchPosition.x + 20< startTouchPosition.x){ + if(endTouchPosition.x + 200< startTouchPosition.x){ //left goLeft(); @@ -46,11 +53,11 @@ public class PlayerController : MonoBehaviour } } - private void OnCollisionEnter(Collision collision) { + /*private void OnCollisionEnter(Collision collision) { if (collision.collider.CompareTag("Ground")) { isOnGround = true; } - } + }*/ private void goLeft(){ if(rb.transform.position.x == 3) return; //ne tudjon kimenni a savbol diff --git a/UserSettings/Layouts/default-2021.dwlt b/UserSettings/Layouts/default-2021.dwlt index bddd46e..c0bf8b6 100644 --- a/UserSettings/Layouts/default-2021.dwlt +++ b/UserSettings/Layouts/default-2021.dwlt @@ -74,7 +74,7 @@ MonoBehaviour: m_MinSize: {x: 400, y: 200} m_MaxSize: {x: 32384, y: 16192} vertical: 0 - controlID: 87 + controlID: 26 --- !u!114 &4 MonoBehaviour: m_ObjectHideFlags: 52 @@ -249,7 +249,7 @@ MonoBehaviour: m_MinSize: {x: 300, y: 200} m_MaxSize: {x: 24288, y: 16192} vertical: 1 - controlID: 88 + controlID: 27 --- !u!114 &11 MonoBehaviour: m_ObjectHideFlags: 52 @@ -275,7 +275,7 @@ MonoBehaviour: m_MinSize: {x: 300, y: 100} m_MaxSize: {x: 24288, y: 8096} vertical: 0 - controlID: 89 + controlID: 28 --- !u!114 &12 MonoBehaviour: m_ObjectHideFlags: 52 @@ -343,22 +343,22 @@ MonoBehaviour: m_SkipHidden: 0 m_SearchArea: 1 m_Folders: - - Assets/Resources/Models/World Objects/World 1 + - Assets/Scripts m_Globs: [] m_OriginalText: m_ViewMode: 1 m_StartGridSize: 64 m_LastFolders: - - Assets/Resources/Models/World Objects/World 1 + - Assets/Scripts m_LastFoldersGridSize: -1 m_LastProjectPath: /home/tom/Documents/dev/zarodolgozat/ColorRunner m_LockTracker: m_IsLocked: 0 m_FolderTreeState: - scrollPos: {x: 0, y: 11} - m_SelectedIDs: 20650000 - m_LastClickedID: 25888 - m_ExpandedIDs: 000000006a600000f6640000126500001c65000000ca9a3b + scrollPos: {x: 0, y: 75} + m_SelectedIDs: 04630000 + m_LastClickedID: 25348 + m_ExpandedIDs: 000000006a600000006300000a6300000c6300001263000000ca9a3b m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -617,7 +617,7 @@ MonoBehaviour: floating: 0 collapsed: 0 displayed: 1 - snapOffset: {x: 0, y: 0} + snapOffset: {x: 0, y: 25} snapOffsetDelta: {x: 0, y: 0} snapCorner: 0 id: unity-transform-toolbar @@ -798,9 +798,9 @@ MonoBehaviour: m_PlayAudio: 0 m_AudioPlay: 0 m_Position: - m_Target: {x: 24.894438, y: 17.614296, z: -28.415895} + m_Target: {x: 0.747241, y: 2.3425326, z: -17.715397} speed: 2 - m_Value: {x: 24.894438, y: 17.614296, z: -28.415895} + m_Value: {x: 0.747241, y: 2.3425326, z: -17.715397} m_RenderMode: 0 m_CameraMode: drawMode: 0 @@ -847,19 +847,19 @@ MonoBehaviour: m_GridAxis: 1 m_gridOpacity: 0.5 m_Rotation: - m_Target: {x: 0.221459, y: -0.3821424, z: 0.094858095, w: 0.8921604} + m_Target: {x: 0.03353659, y: -0.28212187, z: 0.009868531, w: 0.95874125} speed: 2 - m_Value: {x: 0.22145623, y: -0.38213763, z: 0.09485691, w: 0.89214927} + m_Value: {x: 0.033536598, y: -0.28212193, z: 0.009868532, w: 0.9587414} m_Size: - m_Target: 4.771561 + m_Target: 3.2369728 speed: 2 - m_Value: 4.771561 + m_Value: 3.2369728 m_Ortho: m_Target: 0 speed: 2 m_Value: 0 m_CameraSettings: - m_Speed: 1 + m_Speed: 1.0005 m_SpeedNormalized: 0.5 m_SpeedMin: 0.001 m_SpeedMax: 2