private void OnDestroy() { Levelcontroller levelController = FindObjectOfType <Levelcontroller>(); if (levelController) { levelController.AttackerDestroyed(); } }
private void Start() { if (instance != null) { Destroy(gameObject); } else { instance = this; DontDestroyOnLoad(gameObject); } }