Skip to content

Better way of adding an Enabled property on a component. #3191

@ferafiks

Description

@ferafiks

Is your feature request related to a problem? Please describe.
Stride does not provide a way to toggle entities, but it does provide a way of toggling all activable components using Entity.EnableAll.

However, there is a bit of inconsistency between Game Studio and the runtime:

  • Game Studio treats all components with an Enabled property (even if manually defined) as activable (the property is placed next to the component name.
  • Stride's EnableAll only works with components deriving from ActivableComponent.

Describe the solution you'd like
Introduce an IActivableComponent interface with a required Enabled property and make Game Studio and EnableAll only treat components with that interface as activable.

Describe alternatives you've considered

  1. Make Game Studio only treat ActivableComponent components as activable - the problem is that ActivableComponent can't have Update or Execute, which is limiting.
  2. Make EnableAll look for Enabled property - seems like it would be too computationally expensive.
  3. Remove EnableAll and instruct users to just remove entities from scenes and store them in a variable - as much as I like this idea, the feature is already there

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions