public void Execute()
    {
        Entity cameraEntity = entityDatabase.QueryEntity <CameraComponent>();
        Entity playerEntity = entityDatabase.QueryEntity <PlayerComponent>();

        CameraTargetComponent cameraTargetComponent = cameraEntity.AddComponent <CameraTargetComponent>();

        cameraTargetComponent.Add(CameraTargetKey.Target, playerEntity);
        cameraTargetComponent.offset = cameraTargetComponent.entity.GetComponent <TransformComponent>().transform.position -
                                       playerEntity.GetComponent <TransformComponent>().transform.position;
    }
Пример #2
0
    public void Execute()
    {
        Entity rootEntity = entityDatabase.QueryEntity(Tag.Root);

        rootEntity.AddComponent <ScoreComponent>().scoreModel  = scoreModel;
        rootEntity.AddComponent <GameDataComponent>().gameData = gameData;
    }
Пример #3
0
    public void Execute()
    {
        for (int i = 0; i < spawners.Length; ++i)
        {
            EnemySpawnerComponent enemySpawnerComponent = entityDatabase.CreateEntity().AddComponent <EnemySpawnerComponent>();;
            enemySpawnerComponent.spawnerData = spawners[i];
            enemySpawnerComponent.timer       = enemySpawnerComponent.spawnerData.spawnTime;
        }

        Entity rootEntity = entityDatabase.QueryEntity(Tag.Root);

        rootEntity.AddComponent <ColliderComponentMap>();
    }