This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using Unity.Entities; | |
| using UnityEngine; | |
| public sealed class EntityBehaviour : MonoBehaviour { | |
| public Entity Entity { get; private set; } | |
| void Awake() { | |
| World world = World.DefaultGameObjectInjectionWorld; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <summary> | |
| /// Immutable interface unity components interact with, delegate the IFeature implementation to a concrete class. | |
| /// FeatureComponent acts as a bridge between the unity eco-system and the IFeature implementation. | |
| /// Additionally, it also implements a factory pattern to instantiate the IFeature implementation. | |
| /// | |
| /// Goal: support change without breaking prefabs and scene references. | |
| /// </summary> | |
| class FeatureComponent : MonoBehaviour, IFeature | |
| { | |
| // Dependencies: ------------------------------------------------------------------------------ |