-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
8 additions
and
4 deletions.
There are no files selected for viewing
12 changes: 8 additions & 4 deletions
12
Assets/Scripts/Layers/Properties/PropertyData/LayerURLPropertyData.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Runtime.Serialization; | ||
using Newtonsoft.Json; | ||
using Netherlands3D.Twin.Projects; | ||
|
||
namespace Netherlands3D.Twin.Layers.Properties | ||
{ | ||
[DataContract(Namespace = "https://netherlands3d.eu/schemas/projects/layers/properties", Name = "Url")] | ||
public class LayerURLPropertyData : LayerPropertyData, ILayerPropertyDataWithAssets | ||
{ | ||
[DataMember] public string url = ""; | ||
|
||
public IEnumerable<LayerAsset> GetAssets() | ||
{ | ||
Uri uri = null; | ||
if (!string.IsNullOrEmpty(url)) | ||
uri = AssetUriFactory.CreateProjectAssetUri(url); | ||
|
||
return new List<LayerAsset>() | ||
{ | ||
new (this, !string.IsNullOrEmpty(url) ? new Uri(url) : null) | ||
new(this, uri) | ||
}; | ||
} | ||
} | ||
} | ||
} |