using System.Collections; using System.Collections.Generic; using UnityEngine; public class Creeper : Opponent { [SerializeField] private GameObject[] creeplings; public override void Death() { for (int i = 0; i < creeplings.Length; i++) { float randomX = Random.Range(0f, 2f) + transform.position.x; Vector3 spawnPosition = new Vector3(randomX, transform.position.y, transform.position.z); GameObject creeplingsInstance = Instantiate(creeplings[i], spawnPosition, Quaternion.identity); } base.Death(); } }