示例#1
0
 void Start()
 {
     spawners    = FindObjectsOfType <DependentSpawner>();
     creditPool  = GetComponent <CreditPool>();
     nextSpawner = searchSpawner();
     nextEnemy   = decideEnemy();
 }
示例#2
0
 // Update is called once per frame
 void Update()
 {
     if (creditPool.spendCredit(nextEnemy.GetComponent <Score>().value))
     {
         nextSpawner.spawn(nextEnemy);
         nextSpawner = searchSpawner();
         nextEnemy   = decideEnemy();
     }
 }