Obstacle Map Changes
This commit is contained in:
@@ -4,14 +4,17 @@ using UnityEngine;
|
||||
public class FallPlatform : MonoBehaviour
|
||||
{
|
||||
public float fallDelay = 2f;
|
||||
public float destroyDelay = 2f;
|
||||
public float resetDelay = 2f;
|
||||
|
||||
bool falling;
|
||||
Rigidbody2D rb;
|
||||
//Vector3 position;
|
||||
|
||||
void Start()
|
||||
{
|
||||
rb = transform.parent.GetComponent<Rigidbody2D>();
|
||||
//position = rb.transform.position;
|
||||
|
||||
}
|
||||
private void OnTriggerEnter2D(Collider2D collision)
|
||||
{
|
||||
@@ -26,7 +29,7 @@ public class FallPlatform : MonoBehaviour
|
||||
falling = true;
|
||||
yield return new WaitForSeconds(fallDelay);
|
||||
rb.bodyType = RigidbodyType2D.Dynamic;
|
||||
yield return new WaitForSeconds(destroyDelay);
|
||||
Destroy(gameObject);
|
||||
//yield return new WaitForSeconds(resetDelay);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user