效果如图,小游戏的话效果还可以
脚本使用DOTween做了顿帧
在场景中新建一个空物体GameController
创建一个C#脚本GameController.cs
把下面的复制进去
using UnityEngine;
using System.Collections;
using DG.Tweening;
public class GameController :MonoBehaviour
{
[Header("第一种敌人")]
public GameObject type01;// 存放敌人prefab
public GameObject type01Death;// 存放敌人死亡prefab
public int type01Count;// type01每一波敌人的个数
public float type01spawnTime;// 每一波中生成下一个敌人的时间间隔
public int type01MaxNum;//场上最大怪物数量
public int type01EnemyNum;//场上的怪物数量
[Header("第二种敌人")]
public GameObject type02;
public GameObject type02Missile;
public GameObject type02Death;// 存放敌人死亡prefab
public int type02ShowScore;//type02多少分以后才会生成
public int type02Count;// type02每一波敌人的个数
public float type02spawnTime;