Wind blows over gaps
This commit is contained in:
@@ -3,6 +3,8 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Bomb : MonoBehaviour {
|
||||
Rigidbody2D rigidBody;
|
||||
|
||||
public float timer;
|
||||
|
||||
GameObject explosion;
|
||||
@@ -10,6 +12,10 @@ public class Bomb : MonoBehaviour {
|
||||
|
||||
float birthTime;
|
||||
|
||||
void Awake() {
|
||||
rigidBody = GetComponent<Rigidbody2D> ();
|
||||
}
|
||||
|
||||
void Start() {
|
||||
StartCoroutine (ExplodeAfter (timer));
|
||||
|
||||
@@ -32,6 +38,11 @@ public class Bomb : MonoBehaviour {
|
||||
iceBlock.GetComponent<BlockIce> ().bombTimer = timer - (Time.time - birthTime);
|
||||
Destroy (gameObject);
|
||||
}
|
||||
|
||||
WindDamager wind = collider.gameObject.GetComponent<WindDamager> ();
|
||||
if (wind != null) {
|
||||
rigidBody.AddForce (collider.gameObject.GetComponent<Rigidbody2D> ().velocity / 2, ForceMode2D.Impulse);
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator ExplodeAfter(float delay) {
|
||||
|
||||
Reference in New Issue
Block a user