fixing fire system

This commit is contained in:
2023-06-28 22:53:31 +03:00
parent 251308ce6a
commit dc770b49af
10 changed files with 260 additions and 41 deletions
+6 -2
View File
@@ -9,9 +9,13 @@ public class MapElement : MonoBehaviour
private float _respawnElementTimer;
private int _respawnTimeout = 4;
private bool _needRespawn = false;
public void Hit()
{
gameObject.GetComponent<BoxCollider2D>().enabled = false;
gameObject.GetComponent<BoxCollider2D>().enabled=false;
gameObject.GetComponentInChildren<SpriteRenderer>().enabled = false;
_respawnElementTimer = _respawnTimeout;
_needRespawn = true;
}
@@ -24,9 +28,9 @@ public class MapElement : MonoBehaviour
{
_respawnElementTimer = _respawnTimeout;
gameObject.GetComponent<BoxCollider2D>().enabled = true;
gameObject.GetComponentInChildren<SpriteRenderer>().enabled = true;
_needRespawn = false;
}
}
}
}