4 using SiliconStudio.Core;
5 using SiliconStudio.Core.IO;
6 using SiliconStudio.Core.Serialization;
7 using SiliconStudio.Core.Serialization.Serializers;
9 namespace SiliconStudio.Assets
14 [DataContract(
"AssetBase")]
18 private readonly
UFile location;
19 private readonly
Asset asset;
24 public static readonly
UFile DefaultImportBase =
new UFile(
"--import--");
41 if (location == null)
throw new ArgumentNullException(
"location");
42 if (asset == null)
throw new ArgumentNullException(
"asset");
43 this.location = location;
51 public string Location
87 public bool IsRootImport
91 return location == DefaultImportBase && Id == Guid.Empty;
97 return string.Format(
"{0} => {1}", location, Id);
106 stream.Write(assetBase.Location);
107 stream.SerializeExtended(assetBase.Asset, mode);
111 var location = stream.ReadString();
113 stream.SerializeExtended(ref asset, mode);
114 assetBase =
new AssetBase(location, asset);
AssetBase(UFile location, Asset asset)
Initializes a new instance of the AssetItem class.
An asset item part of a Package accessible through Package.Assets.
AssetBase(Asset asset)
Initializes a new instance of the AssetBase class.
override string ToString()
Base class for implementation of SerializationStream.
Describes how to serialize and deserialize an object without knowing its type. Used as a common base ...
ArchiveMode
Enumerates the different mode of serialization (either serialization or deserialization).
An interface that provides a reference to an asset.
Defines a normalized file path. See UPath for details. This class cannot be inherited.