public void resetTargets() { destroyBulletsScript.destroyAllBulletsInList(); Destroy(currentTargets); currentTargets = Instantiate(targetsPrefab, targetTransform.position, targetTransform.rotation) as GameObject; destroyBulletsScript = currentTargets.GetComponent<DestroyBullets>(); }
void Start() { destroyBulletsScript = currentTargets.GetComponent<DestroyBullets>(); targetTransform = new SaveTransform(currentTargets.transform); }