Пример #1
0
    void Update()
    {
        if (newEntities.Count > 0)
        {
            int num = newEntities.Count;
            for (int i = 0; i < num; ++i)
            {
                entities.Add(newEntities.Dequeue());
            }
        }

        foreach (Entity entity in entities)
        {
            //Debug.Log("GameWorld.Update, tag:" + entity.identity.tag);
            inputSystem.Update(entity.inputComponent);
            aiSystem.Update(entity.identity, entity.aiComponent, entity.inputComponent);
            controllerSystem.Update(entity.tankComponent, entity.inputComponent, entity.moveComponent, entity.gameobjectComponent);
            gunSystem.Update(entity.gunComponent, entity.inputComponent, entity.gameobjectComponent);
            bulletSystem.Update(entity.identity, entity.bulletComponent, entity.moveComponent, entity.gameobjectComponent);
            buffSystem.Update(entity.buffComponent);
            moveSystem.Update(entity.moveComponent, entity.gameobjectComponent);
        }

        if (expiredEntities.Count > 0)
        {
            Entity entity = null;
            int    num    = expiredEntities.Count;
            for (int i = 0; i < num; ++i)
            {
                entity = expiredEntities.Dequeue();
                entity.gameobjectComponent.Destroy();
                entities.Remove(entity);
            }
        }
    }
Пример #2
0
 public void Update()
 {
     mTankSystem.Update();
     mBulletSystem.Update();
     mStageSystem.Update();
 }