using UnityEngine;
using System.Collections;
public class HpTree : MonoBehaviour {
public float hp;
public GameObject[] Spawn;
void Update () {
if(hp < 0){
for(int i = 0 ; i < Spawn.Length;i++){
Vector3 v3 = new Vector3(transform.position.x,transform.position.y-(Spawn.transform.localScale.y+i+i),transform.position.z);
Instantiate(Spawn,v3,Quaternion.identity);
}
Destroy(this.gameObject);
}
}
}
using System.Collections;
public class HpTree : MonoBehaviour {
public float hp;
public GameObject[] Spawn;
void Update () {
if(hp < 0){
for(int i = 0 ; i < Spawn.Length;i++){
Vector3 v3 = new Vector3(transform.position.x,transform.position.y-(Spawn.transform.localScale.y+i+i),transform.position.z);
Instantiate(Spawn,v3,Quaternion.identity);
}
Destroy(this.gameObject);
}
}
}