public GameObject effectPrefab1, effectPrefab2, effectPrefab3, effectPrefab4, effectPrefab5;
private bool isXian = false;
private int number = 0;
void Start()
{
}
void Update()
{
if (number <= 100)
{
number++;
}
else
{
ShiLiHua(effectPrefab1);
ShiLiHua(effectPrefab2);
ShiLiHua(effectPrefab3);
ShiLiHua(effectPrefab4);
ShiLiHua(effectPrefab5);
number = 0;
}
}
public void ShiLiHua(GameObject game)
{
int number5 = Random.Range(1, 8);
for (int i = 0; i < number; i++)
{
GameObject nn = Instantiate(game);
nn.transform.parent = transform;
float xx = Random.Range(0, 20);
float yy = Random.Range(-8, 8);
float zz = Random.Range(-10, 10);
nn.transform.localPosition = new Vector3(xx, yy, zz);
}
}
五个特效