Ejemplo n.º 1
0
    /// <summary>
    /// Spawns a entity in the gameworld.
    /// </summary>
    public static void SpawnEntity(EntityReferenceData entityReferenceData, Vector3 spawnPos)
    {
        Entity entity = BootStrapper.Entity_Manager.Instantiate
                            (Database.Instance.GetDummyEntity(entityReferenceData.Value));                              // Spawn the entity

        BootStrapper.Entity_Manager.SetComponentData(entity, new Position {
            Value = spawnPos
        });                                                                                                             // Set entitys position
        EntityColliders.AddEntityCollider(spawnPos, entity);                                                            // Spawn a collider for the entity
        RelationshipFinder.UpdateEntityRelationships(entity);
    }
Ejemplo n.º 2
0
    public static bool ValidateRelationship(Entity sourceEntity, Entity entityToBeValidated)
    {
        // Entity reference data
        EntityReferenceData sourceRefData = BootStrapper.Entity_Manager.GetComponentData <EntityReferenceData>(entityToBeValidated);
        EntityReferenceData targetRefData = BootStrapper.Entity_Manager.GetComponentData <EntityReferenceData>(entityToBeValidated);
        //if ()
        Position sourcePosData = BootStrapper.Entity_Manager.GetComponentData <Position>(sourceEntity);
        Position targetPosData = BootStrapper.Entity_Manager.GetComponentData <Position>(entityToBeValidated);
        bool     valid         = false;


        //if ()
        // Not a valid entity
        return(valid);
    }