Edit some push and pull
This commit is contained in:
parent
35c93c6a4b
commit
62f648cfb5
@ -178,10 +178,10 @@ public class PlayerController : MonoBehaviour
|
||||
switch (platform.type)
|
||||
{
|
||||
case PlatformManager.PlatformType.Push:
|
||||
rb.AddExplosionForce(platform.speed * Time.deltaTime * 10, other.gameObject.transform.position, 10);
|
||||
rb.AddForce(other.GetContact(0).normal * platform.speed * Time.deltaTime, ForceMode.Impulse);
|
||||
break;
|
||||
case PlatformManager.PlatformType.Pull:
|
||||
rb.AddExplosionForce(-platform.speed * Time.deltaTime * 10, other.gameObject.transform.position, 10);
|
||||
rb.AddForce(-other.GetContact(0).normal * platform.speed * Time.deltaTime, ForceMode.Impulse);
|
||||
break;
|
||||
case PlatformManager.PlatformType.RotateY:
|
||||
break;
|
||||
@ -198,11 +198,11 @@ public class PlayerController : MonoBehaviour
|
||||
}
|
||||
break;
|
||||
default:
|
||||
gDirection = -transform.up;
|
||||
gDirection = -other.GetContact(0).normal;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
gDirection = -transform.up;
|
||||
gDirection = -other.GetContact(0).normal;
|
||||
}
|
||||
platformForward = other.transform.forward;
|
||||
this.downDirection = gDirection;
|
||||
|
@ -9,11 +9,14 @@ EditorUserSettings:
|
||||
value: 5150040003515f5f585f552011755e4446154e2e2a2a7e347c2c4965b1b4366a
|
||||
flags: 0
|
||||
RecentlyUsedSceneGuid-1:
|
||||
value: 5a5757560101590a5d0c0e24427b5d44434e4c7a7b7a23677f2b4565b7b5353a
|
||||
value: 50080c5756540a5e095b0d7a11210644154f1b7f782922642f281b35b0b86c6d
|
||||
flags: 0
|
||||
RecentlyUsedSceneGuid-2:
|
||||
value: 5b53500307070b0b0b0f5a2648735a4412154f737d2b2536782f1e32e0b86c3a
|
||||
flags: 0
|
||||
RecentlyUsedSceneGuid-3:
|
||||
value: 5a5757560101590a5d0c0e24427b5d44434e4c7a7b7a23677f2b4565b7b5353a
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-0:
|
||||
value: 22424703114646680e0b0227036c6c111b07142f1f2b233e2867083debf42d
|
||||
flags: 0
|
||||
|
Loading…
Reference in New Issue
Block a user