Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[solved]ForEach but requiring a specific component.

Discussion in 'Entity Component System' started by Mr-Mechanical, Dec 21, 2019.

  1. Mr-Mechanical

    Mr-Mechanical

    Joined:
    May 31, 2015
    Posts:
    507
    I have an Entity type which I'd like to access, but only 1 of 2 components will actually be read. How do I require a component without having to load it into cache?
     
  2. Mr-Mechanical

    Mr-Mechanical

    Joined:
    May 31, 2015
    Posts:
    507
    Edit: my bad, it's still [RequireComponentTag(typeof(Component))]