Edit player controller
This commit is contained in:
parent
6f1d3b9cac
commit
06eb63d3a9
@ -168,29 +168,33 @@ public class PlayerController : MonoBehaviour
|
|||||||
Vector3 gDirection;
|
Vector3 gDirection;
|
||||||
PlatformManager platform = other.gameObject.GetComponent<PlatformManager>();
|
PlatformManager platform = other.gameObject.GetComponent<PlatformManager>();
|
||||||
gDirection = -other.GetContact(0).normal;
|
gDirection = -other.GetContact(0).normal;
|
||||||
switch (platform.type)
|
if (platform != null) {
|
||||||
{
|
switch (platform.type)
|
||||||
case PlatformManager.PlatformType.Push:
|
{
|
||||||
break;
|
case PlatformManager.PlatformType.Push:
|
||||||
case PlatformManager.PlatformType.Pull:
|
break;
|
||||||
break;
|
case PlatformManager.PlatformType.Pull:
|
||||||
case PlatformManager.PlatformType.RotateY:
|
break;
|
||||||
break;
|
case PlatformManager.PlatformType.RotateY:
|
||||||
case PlatformManager.PlatformType.RotateZ:
|
break;
|
||||||
break;
|
case PlatformManager.PlatformType.RotateZ:
|
||||||
case PlatformManager.PlatformType.SpeedUp:
|
break;
|
||||||
modifier += platform.speed;
|
case PlatformManager.PlatformType.SpeedUp:
|
||||||
break;
|
modifier += platform.speed;
|
||||||
case PlatformManager.PlatformType.SpeedDown:
|
break;
|
||||||
if (modifier - platform.speed >= 0) {
|
case PlatformManager.PlatformType.SpeedDown:
|
||||||
modifier -= platform.speed;
|
if (modifier - platform.speed >= 0) {
|
||||||
} else {
|
modifier -= platform.speed;
|
||||||
modifier = 0.0f;
|
} else {
|
||||||
}
|
modifier = 0.0f;
|
||||||
break;
|
}
|
||||||
default:
|
break;
|
||||||
gDirection = -transform.up;
|
default:
|
||||||
break;
|
gDirection = -transform.up;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
gDirection = -transform.up;
|
||||||
}
|
}
|
||||||
platformForward = other.transform.forward;
|
platformForward = other.transform.forward;
|
||||||
this.downDirection = gDirection;
|
this.downDirection = gDirection;
|
||||||
|
@ -6,16 +6,13 @@ EditorUserSettings:
|
|||||||
serializedVersion: 4
|
serializedVersion: 4
|
||||||
m_ConfigSettings:
|
m_ConfigSettings:
|
||||||
RecentlyUsedSceneGuid-0:
|
RecentlyUsedSceneGuid-0:
|
||||||
value: 50080c5756540a5e095b0d7a11210644154f1b7f782922642f281b35b0b86c6d
|
value: 5150040003515f5f585f552011755e4446154e2e2a2a7e347c2c4965b1b4366a
|
||||||
flags: 0
|
flags: 0
|
||||||
RecentlyUsedSceneGuid-1:
|
RecentlyUsedSceneGuid-1:
|
||||||
value: 5a5757560101590a5d0c0e24427b5d44434e4c7a7b7a23677f2b4565b7b5353a
|
|
||||||
flags: 0
|
|
||||||
RecentlyUsedSceneGuid-2:
|
|
||||||
value: 5b53500307070b0b0b0f5a2648735a4412154f737d2b2536782f1e32e0b86c3a
|
value: 5b53500307070b0b0b0f5a2648735a4412154f737d2b2536782f1e32e0b86c3a
|
||||||
flags: 0
|
flags: 0
|
||||||
RecentlyUsedSceneGuid-3:
|
RecentlyUsedSceneGuid-2:
|
||||||
value: 5150040003515f5f585f552011755e4446154e2e2a2a7e347c2c4965b1b4366a
|
value: 5a5757560101590a5d0c0e24427b5d44434e4c7a7b7a23677f2b4565b7b5353a
|
||||||
flags: 0
|
flags: 0
|
||||||
RecentlyUsedScenePath-0:
|
RecentlyUsedScenePath-0:
|
||||||
value: 22424703114646680e0b0227036c6c111b07142f1f2b233e2867083debf42d
|
value: 22424703114646680e0b0227036c6c111b07142f1f2b233e2867083debf42d
|
||||||
|
Loading…
Reference in New Issue
Block a user