Commit 9f58eadb authored by Jan Meissner's avatar Jan Meissner
Browse files

Optimized ProjektilController

parent 8900a634
using UnityEngine;
public class ProjektilController : MonoBehaviour {
private void OnTriggerEnter2D(Collider2D other) {
Debug.Log(other.name);
if (other.gameObject.name != "Cannon" || other.gameObject.name != "CannonBarrel") { }
else {
Destroy(gameObject);
PlayerActor player = other.GetComponent<PlayerActor>();
if (player != null) {
player.Die();
}
}
Destroy(gameObject);
}
void OnBecameInvisible() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment