Skip to content

State in system instead of component #1

Description

@JamesMcMahon

I noticed you are keeping your object pool as state in your system instance,
https://github.com/sschmid/Entitas-Shmup/blob/master/Assets/Sources/Features/Input/ProcessShootInputSystem.cs#L12

readonly ObjectPool<GameObject> _bulletsObjectPool;
// snipped code

public ProcessShootInputSystem(Pool corePool, Pool bulletsPool) {
    // more snipped code
    _bulletsObjectPool = new ObjectPool<GameObject>(() => Object.Instantiate(Resources.Load<GameObject>(Res.Bullet)));
}

I've been going back and forth between how much state I store in the systems themselves vs components. Do you think this would be better served as a component?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions