]> git.lizzy.rs Git - SuperMouseAdventure.git/commitdiff
parallax effect v1.0.2
authorKG0104 <konstantin.gerlach@kabelmail.de>
Sat, 23 Oct 2021 15:49:56 +0000 (17:49 +0200)
committerKG0104 <konstantin.gerlach@kabelmail.de>
Sat, 23 Oct 2021 15:49:56 +0000 (17:49 +0200)
2DGame/Assets/Scenes/(1) Green_Idyll/green_idyll_10.unity
2DGame/Assets/Scripts/Background/Parallaxing.cs
2DGame/Assets/Scripts/Mouse/KeyHolder.cs
2DGame/Packages/manifest.json
2DGame/Packages/packages-lock.json
2DGame/ProjectSettings/ProjectVersion.txt

index df695a0dc72689cf7d56ffd04da0b2e483d37ea8..5cdafa2bd4b635d9170ddcb2f8317a7aa50b2a31 100644 (file)
@@ -1933,7 +1933,7 @@ HingeJoint2D:
   m_BreakTorque: Infinity
   m_AutoConfigureConnectedAnchor: 1
   m_Anchor: {x: 0, y: 0}
-  m_ConnectedAnchor: {x: 1.5330272, y: 0.000013727693}
+  m_ConnectedAnchor: {x: 1.5330272, y: 0.000013543291}
   m_UseMotor: 0
   m_Motor:
     m_MotorSpeed: 0
@@ -15135,7 +15135,7 @@ HingeJoint2D:
   m_BreakTorque: Infinity
   m_AutoConfigureConnectedAnchor: 1
   m_Anchor: {x: 0, y: 0}
-  m_ConnectedAnchor: {x: 1.6145648, y: 0.000011488793}
+  m_ConnectedAnchor: {x: 1.6145648, y: 0.000011680645}
   m_UseMotor: 0
   m_Motor:
     m_MotorSpeed: 0
index 79fbe948df82a8d3f3b54a010179b2edaed43d2d..3abc452140ea8a61e2a8c3e5aef5e76a24b26091 100644 (file)
@@ -19,11 +19,11 @@ public class Parallaxing : MonoBehaviour
         lastCameraPosition = cameraTransform.position;
         Sprite sprite = GetComponent<SpriteRenderer>().sprite;
         Texture2D texture = sprite.texture;
-        textureUnitSizeX = texture.width / sprite.pixelsPerUnit;
-        textureUnitSizeY = texture.height / sprite.pixelsPerUnit;
+        textureUnitSizeX = (texture.width / sprite.pixelsPerUnit) * transform.localScale.x;
+        textureUnitSizeY = (texture.height / sprite.pixelsPerUnit) * transform.localScale.y;
     }
 
-    private void LateUpdate()
+    private void FixedUpdate()
     {
         Vector3 deltaMovement = cameraTransform.position - lastCameraPosition;
         transform.position += new Vector3(deltaMovement.x * parallaxEffectMultiplier.x, deltaMovement.y * parallaxEffectMultiplier.y);
@@ -43,8 +43,8 @@ public class Parallaxing : MonoBehaviour
             if (Mathf.Abs(cameraTransform.position.y - transform.position.y) >= textureUnitSizeY)
             {
                 float offsetPositionY = (cameraTransform.position.y - transform.position.y) % textureUnitSizeY;
-                transform.position = new Vector3(transform.position.y, cameraTransform.position.y + offsetPositionY);
+                transform.position = new Vector3(transform.position.x, cameraTransform.position.y + offsetPositionY);
             }
         }
     }
-}
+}
\ No newline at end of file
index 1053b5fd9cfd8f3ecf365733bf6d423ad5625171..72530a05ef135b1179a9e02c7f2253660b22e9cd 100644 (file)
@@ -4,5 +4,5 @@ using UnityEngine;
 
 public class KeyHolder : MonoBehaviour
 {
-    public Key followingKey;
+    [HideInInspector] public Key followingKey;
 }
index 1f6f83ad0c55092aa2be3bb792ab941a3aa8ea4d..72e082396b9c6057995bffce83099b640df074f6 100644 (file)
@@ -1,13 +1,13 @@
 {
   "dependencies": {
-    "com.unity.2d.animation": "5.0.5",
+    "com.unity.2d.animation": "5.0.8",
     "com.unity.2d.sprite": "1.0.0",
     "com.unity.2d.tilemap": "1.0.0",
     "com.unity.cinemachine": "2.6.10",
-    "com.unity.collab-proxy": "1.3.9",
+    "com.unity.collab-proxy": "1.13.5",
     "com.unity.ide.rider": "2.0.7",
     "com.unity.ide.visualstudio": "2.0.11",
-    "com.unity.render-pipelines.universal": "10.3.2",
+    "com.unity.render-pipelines.universal": "10.6.0",
     "com.unity.test-framework": "1.1.29",
     "com.unity.textmeshpro": "3.0.6",
     "com.unity.timeline": "1.4.8",
index b8bf58bf89205f6e8ed34d0b30dba77b23609a26..d3060018b573749a36ea2d226093bebb9aac62d3 100644 (file)
@@ -1,7 +1,7 @@
 {
   "dependencies": {
     "com.unity.2d.animation": {
-      "version": "5.0.5",
+      "version": "5.0.8",
       "depth": 0,
       "source": "registry",
       "dependencies": {
       "url": "https://packages.unity.com"
     },
     "com.unity.collab-proxy": {
-      "version": "1.3.9",
+      "version": "1.13.5",
       "depth": 0,
       "source": "registry",
-      "dependencies": {},
+      "dependencies": {
+        "com.unity.nuget.newtonsoft-json": "2.0.0",
+        "com.unity.services.core": "1.0.1"
+      },
       "url": "https://packages.unity.com"
     },
     "com.unity.ext.nunit": {
       "dependencies": {},
       "url": "https://packages.unity.com"
     },
+    "com.unity.nuget.newtonsoft-json": {
+      "version": "2.0.0",
+      "depth": 1,
+      "source": "registry",
+      "dependencies": {},
+      "url": "https://packages.unity.com"
+    },
     "com.unity.render-pipelines.core": {
-      "version": "10.3.2",
+      "version": "10.6.0",
       "depth": 1,
       "source": "registry",
       "dependencies": {
       "url": "https://packages.unity.com"
     },
     "com.unity.render-pipelines.universal": {
-      "version": "10.3.2",
+      "version": "10.6.0",
       "depth": 0,
       "source": "registry",
       "dependencies": {
         "com.unity.mathematics": "1.1.0",
-        "com.unity.render-pipelines.core": "10.3.2",
-        "com.unity.shadergraph": "10.3.2"
+        "com.unity.render-pipelines.core": "10.6.0",
+        "com.unity.shadergraph": "10.6.0"
       },
       "url": "https://packages.unity.com"
     },
     "com.unity.searcher": {
-      "version": "4.3.1",
+      "version": "4.3.2",
       "depth": 2,
       "source": "registry",
       "dependencies": {},
       "url": "https://packages.unity.com"
     },
+    "com.unity.services.core": {
+      "version": "1.0.1",
+      "depth": 1,
+      "source": "registry",
+      "dependencies": {
+        "com.unity.modules.unitywebrequest": "1.0.0"
+      },
+      "url": "https://packages.unity.com"
+    },
     "com.unity.shadergraph": {
-      "version": "10.3.2",
+      "version": "10.6.0",
       "depth": 1,
       "source": "registry",
       "dependencies": {
-        "com.unity.render-pipelines.core": "10.3.2",
-        "com.unity.searcher": "4.3.1"
+        "com.unity.render-pipelines.core": "10.6.0",
+        "com.unity.searcher": "4.3.2"
       },
       "url": "https://packages.unity.com"
     },
index 6830e2a84b51a0bc88647a16930fb2f02b7cc4b7..d2eb005321d5f26575c212ddf563e0b6d6eeba0f 100644 (file)
@@ -1,2 +1,2 @@
-m_EditorVersion: 2020.3.1f1
-m_EditorVersionWithRevision: 2020.3.1f1 (77a89f25062f)
+m_EditorVersion: 2020.3.21f1
+m_EditorVersionWithRevision: 2020.3.21f1 (a38c86f6690f)