Wind blows over gaps
This commit is contained in:
@@ -3,10 +3,16 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class BlockIce : MonoBehaviour {
|
||||
Rigidbody2D rigidBody;
|
||||
|
||||
public float bombTimer = -1;
|
||||
|
||||
public GameObject bombPrefab;
|
||||
|
||||
void Awake() {
|
||||
rigidBody = GetComponent<Rigidbody2D> ();
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D collider) {
|
||||
//TODO: use durability class?
|
||||
FireDamager fire = collider.gameObject.GetComponent<FireDamager> ();
|
||||
@@ -18,5 +24,10 @@ public class BlockIce : MonoBehaviour {
|
||||
}
|
||||
Destroy (gameObject);
|
||||
}
|
||||
|
||||
WindDamager wind = collider.gameObject.GetComponent<WindDamager> ();
|
||||
if (wind != null) {
|
||||
rigidBody.AddForce (collider.gameObject.GetComponent<Rigidbody2D> ().velocity * 20, ForceMode2D.Impulse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user