Change some prefabs platform and player reaction
This commit is contained in:
parent
cd9111e366
commit
bae2df3fd8
@ -198,8 +198,8 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: fdc803964e5f2b042bece1765b69164f, type: 3}
|
m_Script: {fileID: 11500000, guid: fdc803964e5f2b042bece1765b69164f, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
type: 0
|
type: 2
|
||||||
speed: 5
|
speed: 10
|
||||||
--- !u!65 &8238111678033492397
|
--- !u!65 &8238111678033492397
|
||||||
BoxCollider:
|
BoxCollider:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -199,7 +199,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: fdc803964e5f2b042bece1765b69164f, type: 3}
|
m_Script: {fileID: 11500000, guid: fdc803964e5f2b042bece1765b69164f, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
type: 1
|
type: 0
|
||||||
speed: 5
|
speed: 5
|
||||||
--- !u!65 &3865253352867341094
|
--- !u!65 &3865253352867341094
|
||||||
BoxCollider:
|
BoxCollider:
|
||||||
|
@ -198,7 +198,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: fdc803964e5f2b042bece1765b69164f, type: 3}
|
m_Script: {fileID: 11500000, guid: fdc803964e5f2b042bece1765b69164f, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
type: 5
|
type: 6
|
||||||
speed: 10
|
speed: 10
|
||||||
--- !u!65 &6218203028538785626
|
--- !u!65 &6218203028538785626
|
||||||
BoxCollider:
|
BoxCollider:
|
||||||
|
@ -198,8 +198,8 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: fdc803964e5f2b042bece1765b69164f, type: 3}
|
m_Script: {fileID: 11500000, guid: fdc803964e5f2b042bece1765b69164f, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
type: 0
|
type: 1
|
||||||
speed: 5
|
speed: 10
|
||||||
--- !u!65 &5316890779910729157
|
--- !u!65 &5316890779910729157
|
||||||
BoxCollider:
|
BoxCollider:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -198,7 +198,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: fdc803964e5f2b042bece1765b69164f, type: 3}
|
m_Script: {fileID: 11500000, guid: fdc803964e5f2b042bece1765b69164f, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
type: 4
|
type: 5
|
||||||
speed: 10
|
speed: 10
|
||||||
--- !u!65 &4344779564172896453
|
--- !u!65 &4344779564172896453
|
||||||
BoxCollider:
|
BoxCollider:
|
||||||
|
@ -4,7 +4,7 @@ using UnityEngine;
|
|||||||
|
|
||||||
public class PlatformManager : MonoBehaviour
|
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 PlatformType type = PlatformType.Pull;
|
||||||
public float speed = 5;
|
public float speed = 5;
|
||||||
|
|
||||||
|
@ -178,8 +178,10 @@ public class PlayerController : MonoBehaviour
|
|||||||
switch (platform.type)
|
switch (platform.type)
|
||||||
{
|
{
|
||||||
case PlatformManager.PlatformType.Push:
|
case PlatformManager.PlatformType.Push:
|
||||||
|
rb.AddExplosionForce(platform.speed * Time.deltaTime * 10, other.gameObject.transform.position, 10);
|
||||||
break;
|
break;
|
||||||
case PlatformManager.PlatformType.Pull:
|
case PlatformManager.PlatformType.Pull:
|
||||||
|
rb.AddExplosionForce(-platform.speed * Time.deltaTime * 10, other.gameObject.transform.position, 10);
|
||||||
break;
|
break;
|
||||||
case PlatformManager.PlatformType.RotateY:
|
case PlatformManager.PlatformType.RotateY:
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user