Change some prefabs platform and player reaction

This commit is contained in:
haitem
2022-01-29 20:12:11 +01:00
parent cd9111e366
commit bae2df3fd8
7 changed files with 10 additions and 8 deletions

View File

@@ -4,7 +4,7 @@ using UnityEngine;
public class PlatformManager : MonoBehaviour
{
public enum PlatformType {Pull, Push, RotateZ, RotateY, SpeedUp, SpeedDown};
public enum PlatformType {Basic, Pull, Push, RotateZ, RotateY, SpeedUp, SpeedDown};
public PlatformType type = PlatformType.Pull;
public float speed = 5;

View File

@@ -178,8 +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);
break;
case PlatformManager.PlatformType.Pull:
rb.AddExplosionForce(-platform.speed * Time.deltaTime * 10, other.gameObject.transform.position, 10);
break;
case PlatformManager.PlatformType.RotateY:
break;