Ejemplo n.º 1
0
 public static SphereShape CreateEntityWithSphereShape(ParcelScene scene, Vector3 position,
                                                       SphereShape.Model model = null)
 {
     return(CreateEntityWithPrimitive <SphereShape, SphereShape.Model>(scene, position, CLASS_ID.SPHERE_SHAPE,
                                                                       model));
 }
Ejemplo n.º 2
0
    public IEnumerator VisibleProperty()
    {
        string entityId = "entityId";

        TestHelpers.CreateSceneEntity(scene, entityId);
        var entity = scene.entities[entityId];

        TestHelpers.SetEntityTransform(scene, entity, new DCLTransform.Model {
            position = new Vector3(8, 1, 8)
        });

        yield return(null);

        // BoxShape
        BaseShape.Model shapeModel     = new BoxShape.Model();
        BaseShape       shapeComponent = TestHelpers.SharedComponentCreate <BoxShape, BaseShape.Model>(scene, CLASS_ID.BOX_SHAPE, shapeModel);

        yield return(shapeComponent.routine);

        TestHelpers.SharedComponentAttach(shapeComponent, entity);

        yield return(TestHelpers.TestShapeVisibility(shapeComponent, shapeModel, entity));

        TestHelpers.DetachSharedComponent(scene, entityId, shapeComponent.id);
        shapeComponent.Dispose();
        yield return(null);

        // SphereShape
        shapeModel     = new SphereShape.Model();
        shapeComponent = TestHelpers.SharedComponentCreate <SphereShape, BaseShape.Model>(scene, CLASS_ID.SPHERE_SHAPE, shapeModel);
        yield return(shapeComponent.routine);

        TestHelpers.SharedComponentAttach(shapeComponent, entity);

        yield return(TestHelpers.TestShapeVisibility(shapeComponent, shapeModel, entity));

        TestHelpers.DetachSharedComponent(scene, entityId, shapeComponent.id);
        shapeComponent.Dispose();
        yield return(null);

        // ConeShape
        shapeModel     = new ConeShape.Model();
        shapeComponent = TestHelpers.SharedComponentCreate <ConeShape, BaseShape.Model>(scene, CLASS_ID.CONE_SHAPE, shapeModel);
        yield return(shapeComponent.routine);

        TestHelpers.SharedComponentAttach(shapeComponent, entity);

        yield return(TestHelpers.TestShapeVisibility(shapeComponent, shapeModel, entity));

        TestHelpers.DetachSharedComponent(scene, entityId, shapeComponent.id);
        shapeComponent.Dispose();
        yield return(null);

        // CylinderShape
        shapeModel     = new CylinderShape.Model();
        shapeComponent = TestHelpers.SharedComponentCreate <CylinderShape, BaseShape.Model>(scene, CLASS_ID.CYLINDER_SHAPE, shapeModel);
        yield return(shapeComponent.routine);

        TestHelpers.SharedComponentAttach(shapeComponent, entity);

        yield return(TestHelpers.TestShapeVisibility(shapeComponent, shapeModel, entity));

        TestHelpers.DetachSharedComponent(scene, entityId, shapeComponent.id);
        shapeComponent.Dispose();
        yield return(null);

        // PlaneShape
        shapeModel     = new PlaneShape.Model();
        shapeComponent = TestHelpers.SharedComponentCreate <PlaneShape, BaseShape.Model>(scene, CLASS_ID.PLANE_SHAPE, shapeModel);
        yield return(shapeComponent.routine);

        TestHelpers.SharedComponentAttach(shapeComponent, entity);

        yield return(TestHelpers.TestShapeVisibility(shapeComponent, shapeModel, entity));

        TestHelpers.DetachSharedComponent(scene, entityId, shapeComponent.id);
        shapeComponent.Dispose();
        yield return(null);
    }