diff --git a/Assets/Scenes/OverDevScene.unity b/Assets/Scenes/OverDevScene.unity index c6e4cff..c37e835 100644 --- a/Assets/Scenes/OverDevScene.unity +++ b/Assets/Scenes/OverDevScene.unity @@ -140,7 +140,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3453266731971349113, guid: 821831f062ee52848b6bda27fba0b001, type: 3} propertyPath: m_LocalPosition.y - value: -2.1712146 + value: -12.44 objectReference: {fileID: 0} - target: {fileID: 3453266731971349113, guid: 821831f062ee52848b6bda27fba0b001, type: 3} propertyPath: m_LocalPosition.z @@ -176,7 +176,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3453266731971349115, guid: 821831f062ee52848b6bda27fba0b001, type: 3} propertyPath: m_BodyType - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 3453266731971349115, guid: 821831f062ee52848b6bda27fba0b001, type: 3} propertyPath: m_Constraints @@ -190,6 +190,18 @@ PrefabInstance: propertyPath: m_GravityScale value: 0 objectReference: {fileID: 0} + - target: {fileID: 3453266731971349115, guid: 821831f062ee52848b6bda27fba0b001, type: 3} + propertyPath: m_CollisionDetection + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3453266731971349117, guid: 821831f062ee52848b6bda27fba0b001, type: 3} + propertyPath: speed + value: 0.05 + objectReference: {fileID: 0} + - target: {fileID: 3453266731971349117, guid: 821831f062ee52848b6bda27fba0b001, type: 3} + propertyPath: xOffset + value: 5 + objectReference: {fileID: 0} - target: {fileID: 3453266731971349118, guid: 821831f062ee52848b6bda27fba0b001, type: 3} propertyPath: m_Name value: Moving_Platform_Medium @@ -2967,6 +2979,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 2662163039882375472, guid: 1da5e227ed55bcd4b943e0ceef78aefb, type: 3} + propertyPath: m_LocalPosition.x + value: 14.936234 + objectReference: {fileID: 0} + - target: {fileID: 2662163039882375472, guid: 1da5e227ed55bcd4b943e0ceef78aefb, type: 3} + propertyPath: m_LocalPosition.y + value: -8.049541 + objectReference: {fileID: 0} - target: {fileID: 2662163039948621854, guid: 1da5e227ed55bcd4b943e0ceef78aefb, type: 3} propertyPath: m_RootOrder value: 3 @@ -3019,6 +3039,14 @@ PrefabInstance: propertyPath: m_Follow value: objectReference: {fileID: 1053905692} + - target: {fileID: 2662163040849090937, guid: 1da5e227ed55bcd4b943e0ceef78aefb, type: 3} + propertyPath: m_LocalPosition.x + value: 14.936234 + objectReference: {fileID: 0} + - target: {fileID: 2662163040849090937, guid: 1da5e227ed55bcd4b943e0ceef78aefb, type: 3} + propertyPath: m_LocalPosition.y + value: -8.049541 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 1da5e227ed55bcd4b943e0ceef78aefb, type: 3} --- !u!1001 &7008207193554258683 @@ -3040,17 +3068,21 @@ PrefabInstance: propertyPath: m_Name value: Player objectReference: {fileID: 0} + - target: {fileID: 7008207192594766310, guid: 2ed6bfce9ad3e19428cb9bef743e0fa3, type: 3} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} - target: {fileID: 7008207192594766311, guid: 2ed6bfce9ad3e19428cb9bef743e0fa3, type: 3} propertyPath: m_RootOrder value: 2 objectReference: {fileID: 0} - target: {fileID: 7008207192594766311, guid: 2ed6bfce9ad3e19428cb9bef743e0fa3, type: 3} propertyPath: m_LocalPosition.x - value: 0 + value: 8.4 objectReference: {fileID: 0} - target: {fileID: 7008207192594766311, guid: 2ed6bfce9ad3e19428cb9bef743e0fa3, type: 3} propertyPath: m_LocalPosition.y - value: 0 + value: -10.04 objectReference: {fileID: 0} - target: {fileID: 7008207192594766311, guid: 2ed6bfce9ad3e19428cb9bef743e0fa3, type: 3} propertyPath: m_LocalPosition.z diff --git a/Assets/Scripts/Platforms/MovingPlatform.cs b/Assets/Scripts/Platforms/MovingPlatform.cs index ea83d3a..9516e5b 100644 --- a/Assets/Scripts/Platforms/MovingPlatform.cs +++ b/Assets/Scripts/Platforms/MovingPlatform.cs @@ -8,6 +8,7 @@ namespace Platforms { public float xOffset; public float yOffset; + public float speed; private Vector3 _originalPos; private Vector3 _futurePos; @@ -29,7 +30,7 @@ namespace Platforms _goingToFuturePos = true; } - private void Update() + private void FixedUpdate() { if (!IsPaused) Move(BaseSpeed); @@ -57,21 +58,37 @@ namespace Platforms public void Move(float value) { + var position = transform.position; switch (_goingToFuturePos) { case true: - _platformRigidbody.AddForce(Vector2.left * 100.0f * Time.deltaTime, ForceMode2D.Impulse); + _platformRigidbody.MovePosition(new Vector2(position.x + speed * GetDecision(xOffset), + position.y + speed * GetDecision(yOffset))); if (Math.Abs(_futurePos.x - transform.position.x) < VerificationOffset && Math.Abs(_futurePos.y - transform.position.y) < VerificationOffset) _goingToFuturePos = false; break; case false: - _platformRigidbody.AddForce(Vector2.left * -100.0f * Time.deltaTime, ForceMode2D.Impulse); + _platformRigidbody.MovePosition(new Vector2(position.x + speed * -GetDecision(xOffset), + position.y + speed * -GetDecision(yOffset))); if (Math.Abs(_originalPos.x - transform.position.x) < VerificationOffset && Math.Abs(_originalPos.y - transform.position.y) < VerificationOffset) _goingToFuturePos = true; break; } } + + private static float GetDecision(float value) + { + switch (value) + { + case < 0: + return -1.0f; + case > 0: + return 1.0f; + } + + return 0.0f; + } } } \ No newline at end of file diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset index b3587c1..ebac16e 100644 --- a/UserSettings/EditorUserSettings.asset +++ b/UserSettings/EditorUserSettings.asset @@ -17,9 +17,6 @@ EditorUserSettings: RecentlyUsedSceneGuid-3: value: 5002060403010b5f0f560e7a47260a444f4f1e2e2f2e27312f7f4536e0b6633d flags: 0 - RecentlyUsedSceneGuid-3: - value: 06550c57540350025c0b0f2747220a44174f4b73297070642b714465b0e6366e - flags: 0 vcSharedLogLevel: value: 0d5e400f0650 flags: 0 diff --git a/UserSettings/Layouts/CurrentMaximizeLayout.dwlt b/UserSettings/Layouts/CurrentMaximizeLayout.dwlt index 55dd78c..34b7600 100644 --- a/UserSettings/Layouts/CurrentMaximizeLayout.dwlt +++ b/UserSettings/Layouts/CurrentMaximizeLayout.dwlt @@ -25,7 +25,7 @@ MonoBehaviour: m_MinSize: {x: 300, y: 200} m_MaxSize: {x: 24288, y: 16192} vertical: 0 - controlID: 874 + controlID: 12715 --- !u!114 &2 MonoBehaviour: m_ObjectHideFlags: 52 @@ -46,9 +46,9 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 1 - y: 19 - width: 879.6 + x: 304 + y: 73.6 + width: 878 height: 493.40002 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: @@ -85,9 +85,9 @@ MonoBehaviour: m_VAllowExceedBaseRangeMax: 1 m_ScaleWithWindow: 0 m_HSlider: 0 - m_VSlider: 0 + m_VSlider: 1 m_IgnoreScrollWheelUntilClicked: 0 - m_EnableMouseInput: 0 + m_EnableMouseInput: 1 m_EnableSliderZoomHorizontal: 0 m_EnableSliderZoomVertical: 0 m_UniformScale: 1 @@ -96,23 +96,23 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 21 - width: 879.6 + width: 878 height: 472.40002 m_Scale: {x: 0.5467593, y: 0.5467593} - m_Translation: {x: 439.8, y: 236.19998} + m_Translation: {x: 439, y: 236.19998} m_MarginLeft: 0 m_MarginRight: 0 m_MarginTop: 0 m_MarginBottom: 0 m_LastShownAreaInsideMargins: serializedVersion: 2 - x: -804.37585 + x: -802.9127 y: -431.99994 - width: 1608.7517 + width: 1605.8254 height: 863.99994 m_MinimalGUI: 1 m_defaultScale: 0.5467593 - m_LastWindowPixelSize: {x: 1099.5, y: 616.75} + m_LastWindowPixelSize: {x: 1097.5, y: 616.75} m_ClearInEditMode: 1 m_NoCameraWarning: 1 m_LowResolutionForAspectRatios: 00000000000100000100 @@ -137,12 +137,12 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 300 + width: 304 height: 730.8 m_MinSize: {x: 100, y: 200} m_MaxSize: {x: 8096, y: 16192} vertical: 1 - controlID: 841 + controlID: 12684 --- !u!114 &4 MonoBehaviour: m_ObjectHideFlags: 52 @@ -160,7 +160,7 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 300 + width: 304 height: 381.6 m_MinSize: {x: 200, y: 200} m_MaxSize: {x: 4000, y: 4000} @@ -191,7 +191,7 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 73.6 - width: 299 + width: 303 height: 360.6 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: @@ -202,7 +202,7 @@ MonoBehaviour: scrollPos: {x: 0, y: 0} m_SelectedIDs: m_LastClickedID: 0 - m_ExpandedIDs: 0cfbffff + m_ExpandedIDs: 327affff247fffffe294ffff0efbffff m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -243,10 +243,10 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 381.6 - width: 300 + width: 304 height: 349.19998 - m_MinSize: {x: 231, y: 271} - m_MaxSize: {x: 10001, y: 10021} + m_MinSize: {x: 230, y: 250} + m_MaxSize: {x: 10000, y: 10000} m_ActualView: {fileID: 7} m_Panes: - {fileID: 7} @@ -274,7 +274,7 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 455.2 - width: 299 + width: 303 height: 328.19998 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: @@ -293,7 +293,7 @@ MonoBehaviour: m_SkipHidden: 0 m_SearchArea: 1 m_Folders: - - Assets + - Assets/Scenes m_Globs: [] m_OriginalText: m_ViewMode: 0 @@ -307,7 +307,7 @@ MonoBehaviour: scrollPos: {x: 0, y: 0} m_SelectedIDs: dc3c0000 m_LastClickedID: 15580 - m_ExpandedIDs: ffffffff00000000b0630000126400001464000016640000186400001a6400001c6400001e64000020640000 + m_ExpandedIDs: ffffffff00000000b0630000126400001464000016640000186400001a6400001c64000020640000166500002065000028650000 m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -333,9 +333,9 @@ MonoBehaviour: m_ResourceFile: m_AssetTreeState: scrollPos: {x: 0, y: 0} - m_SelectedIDs: + m_SelectedIDs: 307affff m_LastClickedID: 0 - m_ExpandedIDs: ffffffff00000000b0630000126400001464000016640000186400001a6400001c6400001e64000020640000 + m_ExpandedIDs: ffffffff00000000b0630000126400001464000016640000186400001a6400001c64000020640000166500002065000028650000 m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -351,7 +351,7 @@ MonoBehaviour: m_IsRenaming: 0 m_OriginalEventType: 11 m_IsRenamingFilename: 1 - m_ClientGUIView: {fileID: 6} + m_ClientGUIView: {fileID: 0} m_SearchString: m_CreateAssetUtility: m_EndAction: {fileID: 0} @@ -360,8 +360,8 @@ MonoBehaviour: m_Icon: {fileID: 0} m_ResourceFile: m_ListAreaState: - m_SelectedInstanceIDs: - m_LastClickedInstanceID: 0 + m_SelectedInstanceIDs: 307affff + m_LastClickedInstanceID: -34256 m_HadKeyboardFocusLastEvent: 0 m_ExpandedInstanceIDs: c6230000d03c0000 m_RenameOverlay: @@ -408,14 +408,14 @@ MonoBehaviour: - {fileID: 11} m_Position: serializedVersion: 2 - x: 300 + x: 304 y: 0 - width: 881.6 + width: 880 height: 730.8 m_MinSize: {x: 100, y: 200} m_MaxSize: {x: 8096, y: 16192} vertical: 1 - controlID: 875 + controlID: 12762 --- !u!114 &9 MonoBehaviour: m_ObjectHideFlags: 52 @@ -433,10 +433,10 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 881.6 + width: 880 height: 514.4 - m_MinSize: {x: 202, y: 221} - m_MaxSize: {x: 4002, y: 4021} + m_MinSize: {x: 200, y: 200} + m_MaxSize: {x: 4000, y: 4000} m_ActualView: {fileID: 2} m_Panes: - {fileID: 10} @@ -463,9 +463,9 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 300 + x: 304 y: 73.6 - width: 879.6 + width: 878 height: 493.40002 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: @@ -476,8 +476,8 @@ MonoBehaviour: floating: 0 collapsed: 0 displayed: 1 - snapOffset: {x: 0, y: 0} - snapOffsetDelta: {x: -100, y: -25.600006} + snapOffset: {x: -101, y: -26} + snapOffsetDelta: {x: 0, y: 0} snapCorner: 3 id: Tool Settings index: 0 @@ -690,9 +690,9 @@ MonoBehaviour: m_PlayAudio: 0 m_AudioPlay: 0 m_Position: - m_Target: {x: 10.327651, y: -1.4996791, z: -0.23214503} + m_Target: {x: 7.612222, y: -1.4387107, z: -0.2254653} speed: 2 - m_Value: {x: 10.327651, y: -1.4996791, z: -0.23214503} + m_Value: {x: 7.612222, y: -1.4387107, z: -0.2254653} m_RenderMode: 0 m_CameraMode: drawMode: 0 @@ -743,9 +743,9 @@ MonoBehaviour: speed: 2 m_Value: {x: 0, y: 0, z: 0, w: 1} m_Size: - m_Target: 14.002075 + m_Target: 9.087455 speed: 2 - m_Value: 14.002075 + m_Value: 9.087455 m_Ortho: m_Target: 1 speed: 2 @@ -787,10 +787,10 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 514.4 - width: 881.6 + width: 880 height: 216.39996 - m_MinSize: {x: 100, y: 100} - m_MaxSize: {x: 4000, y: 4000} + m_MinSize: {x: 102, y: 121} + m_MaxSize: {x: 4002, y: 4021} m_ActualView: {fileID: 12} m_Panes: - {fileID: 12} @@ -816,9 +816,9 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 300 + x: 304 y: 588 - width: 879.6 + width: 878 height: 195.39996 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: @@ -839,12 +839,12 @@ MonoBehaviour: m_Children: [] m_Position: serializedVersion: 2 - x: 1181.6 + x: 1184 y: 0 - width: 354.40002 + width: 352 height: 730.8 - m_MinSize: {x: 275, y: 50} - m_MaxSize: {x: 4000, y: 4000} + m_MinSize: {x: 276, y: 71} + m_MaxSize: {x: 4001, y: 4021} m_ActualView: {fileID: 14} m_Panes: - {fileID: 14} @@ -870,9 +870,9 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 1181.6 + x: 1184 y: 73.6 - width: 353.40002 + width: 351 height: 709.8 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: @@ -884,7 +884,7 @@ MonoBehaviour: m_CachedPref: 160 m_ControlHash: -371814159 m_PrefName: Preview_InspectorPreview - m_LastInspectedObjectInstanceID: -1 + m_LastInspectedObjectInstanceID: -34256 m_LastVerticalScrollValue: 0 m_GlobalObjectId: m_InspectorMode: 0