WGL 4 mesi fa
parent
commit
b367794882

+ 2 - 2
ActionTowerDefense/Assets/Scripts/Characters/Demonic.cs

@@ -311,7 +311,7 @@ public class Demonic : MoveCharacter
                     }
                     velocity.x = velocityAddition;
                     velocity.y = 0;
-                    if (foot.haveGravity)
+                    if (!foot.haveGravity)
                     {
                         transform.position = new Vector3(transform.position.x, platformY, transform.position.z);
                     }
@@ -369,7 +369,7 @@ public class Demonic : MoveCharacter
                         }
                     }
                     velocity.y = 0;
-                    if (foot.haveGravity)
+                    if (!foot.haveGravity)
                     {
                         transform.position = new Vector3(transform.position.x, platformY, transform.position.z);
                     }

+ 2 - 2
ActionTowerDefense/Assets/Scripts/Characters/Enemy.cs

@@ -251,7 +251,7 @@ public class Enemy : MoveCharacter
                         break;
                     }
                     velocity.y = 0;
-                    if (foot.haveGravity)
+                    if (!foot.haveGravity)
                     {
                         transform.position = new Vector3(transform.position.x, platformY, transform.position.z);
                     }
@@ -307,7 +307,7 @@ public class Enemy : MoveCharacter
                         }
                     }
                     velocity.y = 0;
-                    if (foot.haveGravity)
+                    if (!foot.haveGravity)
                     {
                         transform.position = new Vector3(transform.position.x, platformY, transform.position.z);
                     }

+ 2 - 1
ActionTowerDefense/Assets/Scripts/Characters/Foot.cs

@@ -18,6 +18,7 @@ public class Foot : MonoBehaviour
     }
 
     public List<GameObject> trigGroundList;
+    [DisplayOnly] public Platform platform;
 
     private void Awake()
     {
@@ -39,7 +40,7 @@ public class Foot : MonoBehaviour
         }
         else
         {
-            Platform platform = null;
+            platform = null;
             foreach (var item in trigGroundList)
             {
                 platform = item.GetComponent<Platform>();