public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
 {
     conversionSystem.DeclareDependency(gameObject, Dependency);
     dstManager.AddComponentData(entity, new Component
     {
         Value = FindValue(this)
     });
 }
 public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
 {
     conversionSystem.DeclareAssetDependency(gameObject, Asset);
     conversionSystem.DeclareAssetDependency(gameObject, Texture);
     conversionSystem.DeclareAssetDependency(gameObject, Material);
     conversionSystem.DeclareDependency(gameObject, GameObject);
     dstManager.AddComponentData(entity, new ConversionDependencyData
     {
         MaterialColor     = Material != null ? Material.color : default,
예제 #3
0
 public void Convert(Entity entity, EntityManager dstManager,
                     GameObjectConversionSystem conversionSystem)
 {
     dstManager.AddComponentData(entity, new MeshComponent {
         Mesh = MeshFilter.sharedMesh
     });
     // Note the lack of a null check
     conversionSystem.DeclareDependency(gameObject, MeshFilter);
 }
예제 #4
0
 public void Convert(Entity entity, EntityManager dstManager,
                     GameObjectConversionSystem conversionSystem)
 {
     dstManager.AddComponentData(entity, new NameComponent {
         Name = Other.name
     });
     // Note the lack of a null check
     conversionSystem.DeclareDependency(gameObject, Other);
 }
예제 #5
0
        public void Convert(Entity entity, EntityManager dstManager,
                            GameObjectConversionSystem conversionSystem)
        {
            dstManager.AddComponentData(entity, new EntityReference {
                Entity = conversionSystem.GetPrimaryEntity(Other)
            });

            // This line is required right now, unfortunately.
            // Note the lack of a null-check.
            conversionSystem.DeclareDependency(gameObject, Other);
        }
예제 #6
0
        public void Convert(Entity entity, EntityManager dstManager,
                            GameObjectConversionSystem conversionSystem)
        {
            if (Other != null)
            {
                var meshFilter = Other.GetComponent <MeshFilter>();
                dstManager.AddComponentData(entity, new MeshComponent {
                    Mesh = meshFilter.sharedMesh
                });

                // In this case, we need a null-check: meshFilter can only be
                // accessed when Other is not null.
                // It would be simpler to expose a reference to a Meshfilter on this
                // MonoBehaviour.
                conversionSystem.DeclareDependency(gameObject, meshFilter);
            }

            // Note the lack of a null-check
            conversionSystem.DeclareDependency(gameObject, Other);
        }
예제 #7
0
        public void Convert(Entity entity, EntityManager dstManager,
                            GameObjectConversionSystem conversionSystem)
        {
            dstManager.AddComponentData(entity, new Offset {
                Value = transform.position
            });

            // We need to explicitly declare a dependency on the transform data,
            // even when it is on the same object.
            conversionSystem.DeclareDependency(gameObject, transform);
        }
 public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
 {
     if (Dependency == null)
     {
         return;
     }
     if (!SkipDependency)
     {
         conversionSystem.DeclareDependency(gameObject, Dependency);
     }
     dstManager.AddComponentData(entity, new Component
     {
         LocalToWorld = Dependency.localToWorldMatrix
     });
 }
        public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
        {
            conversionSystem.DeclareDependency(gameObject, Other);

            if (Other == null || Other.scene != gameObject.scene)
            {
                dstManager.AddComponentData(entity, new Component {
                    Value = -1
                });
            }
            else
            {
                Versions.TryGetValue(Other, out var version);
                dstManager.AddComponentData(entity, new Component {
                    Value = version
                });
            }
        }