Edit player script
This commit is contained in:
parent
5a1c546b4f
commit
435fea4669
@ -7,8 +7,8 @@ PhysicMaterial:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: PlayerMaterial
|
||||
dynamicFriction: 0
|
||||
staticFriction: 0
|
||||
dynamicFriction: 1
|
||||
staticFriction: 1
|
||||
bounciness: 0
|
||||
frictionCombine: 0
|
||||
bounceCombine: 0
|
||||
|
@ -101,14 +101,13 @@ public class PlayerController : MonoBehaviour
|
||||
{
|
||||
return;
|
||||
}
|
||||
Physics.gravity = this.downDirection * 9.81f;
|
||||
// if (platform.type == PlatformManager.PlatformType.SpeedUp)
|
||||
// {
|
||||
angle = Mathf.Atan2(Vector3.Magnitude(axis), Vector3.Dot(-transform.up, -other.GetContact(0).normal));
|
||||
transform.RotateAround(axis, angle);
|
||||
// }
|
||||
// TODO: Handle other PlatformTypes
|
||||
Physics.gravity = this.downDirection * 9.81f;
|
||||
Physics.gravity = -other.GetContact(0).normal * 9.81f;
|
||||
|
||||
}
|
||||
|
||||
@ -141,7 +140,7 @@ public class PlayerController : MonoBehaviour
|
||||
|
||||
Vector3 gDirection;
|
||||
PlatformManager platform = other.gameObject.GetComponent<PlatformManager>();
|
||||
gDirection = -transform.up;
|
||||
gDirection = -other.GetContact(0).normal;
|
||||
if (platform == null){
|
||||
// FIXME: remove
|
||||
this.downDirection = -transform.up;
|
||||
|
Loading…
Reference in New Issue
Block a user