|
|
@@ -26,7 +26,7 @@ public class Foot : MonoBehaviour
|
|
|
moveCharacter = rb.transform.GetComponent<MoveCharacter>();
|
|
|
}
|
|
|
|
|
|
- private void FixedUpdate()
|
|
|
+ private void Update()
|
|
|
{
|
|
|
if (trigGroundList.Count == 0)
|
|
|
{
|
|
|
@@ -41,7 +41,7 @@ public class Foot : MonoBehaviour
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- platform = null;
|
|
|
+ Platform plf = null;
|
|
|
foreach (var item in trigGroundList)
|
|
|
{
|
|
|
Platform newPlatform = item.GetComponent<Platform>();
|
|
|
@@ -50,19 +50,19 @@ public class Foot : MonoBehaviour
|
|
|
if (moveCharacter.transform.position.x < newPlatform.right.position.x
|
|
|
&& moveCharacter.transform.position.x > newPlatform.left.position.x)
|
|
|
{
|
|
|
- if(platform == null)
|
|
|
+ if(plf == null)
|
|
|
{
|
|
|
- platform = newPlatform;
|
|
|
+ plf = newPlatform;
|
|
|
}
|
|
|
else if (newPlatform.haveMagnetic)
|
|
|
{
|
|
|
- platform = newPlatform;
|
|
|
+ plf = newPlatform;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ platform = plf;
|
|
|
|
|
|
if (platform != null)
|
|
|
{
|