Exemplo n.º 1
0
 // 実際のアリ生成関数
 IEnumerator Spawn()
 {
     if (DeltaTimeFromLastSpawn >= SpawnInterval)
     {
         // アリ生成
         UnemployedAntData data = new UnemployedAntData()
         {
             Position = transform.position,
         };
         NestSystem.Instance.InstantiateAnt(data);
         lastSpawnedTime = CurrentTime;
     }
     return(null);
 }
Exemplo n.º 2
0
        // 実際のアリ生成関数
        public IEnumerator Spawn()
        {
            while (true)
            {
                yield return(new WaitForSeconds(SpawnInterval));

                if (!NestSystem.Instance.GetAnts <QueenAnt>().Any())
                {
                    continue;
                }
                // アリ生成
                for (int i = 0; i < NestSystem.Instance.Data.CommonDataRegistry.GetCommonData <QueenAntCommonData>().BasicEfficiency; i++)
                {
                    UnemployedAntData data = new UnemployedAntData()
                    {
                        Position = transform.position,
                    };
                    var ant = NestSystem.Instance.InstantiateAnt(data);
                    JobAssignmentSystem.AssignJob(ant);
                    lastSpawnedTime = CurrentTime;
                }
            }
        }