using System.Collections; using System.Collections.Generic; using UnityEngine; public class TargetingButton : MonoBehaviour { public Transform enemy; public void Update() { if(enemy == null) Destroy(gameObject); } public void TargetSelected() { GameObject.FindGameObjectWithTag("Player").GetComponent().ShootMissle(enemy); } }