Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[Tutorial] Unity ECS: Pure vs Hybrid (including a walkthrough)

Discussion in 'Community Learning & Teaching' started by charlesamat, Apr 9, 2018.

  1. charlesamat

    charlesamat

    Joined:
    Feb 5, 2014
    Posts:
    66
  2. Matt1988

    Matt1988

    Joined:
    Sep 14, 2012
    Posts:
    23
    Hi Charles! This was a great video and it has helped loads in understanding the new ECS system. I do however have a question that your video didn't answer for me (Or I just plain missed it altogether). I'm going through the Twin Stick Shooter sample that Unity has on their Github, and I am finding [Inject] Attributes all over the place. Do you know how this dependancy injection works?

    Example:
    Code (CSharp):
    1. public struct PlayerData
    2.         {
    3.             public int Length;
    4.             public ComponentArray<Position2D> Position;
    5.             public ComponentArray<PlayerInput> PlayerInput;
    6.         }
    7.  
    8.         [Inject] private PlayerData m_Player;
    If this is as simple as I think it may be, is it similar to using GetEntities<PlayerData>?
     
  3. Matt1988

    Matt1988

    Joined:
    Sep 14, 2012
    Posts:
    23