C# Class Google.VersionHandler.FileMetadata

Derives metadata from an asset filename.
Datei anzeigen Open project: googlesamples/unity-jar-resolver

Public Properties

Property Type Description
ASSET_LABEL string
BUILD_TARGET_NAME_TO_ENUM BuildTarget>.Dictionary
filename string
filenameCanonical string
isManifest bool
targets string[]
versionString string

Public Methods

Method Description
CalculateVersion ( ) : long

Get a numeric version number. Each component is multiplied by VERSION_COMPONENT_MULTIPLIER^(MAX_VERSION_COMPONENTS - (component_index + 1)) and accumulated in the returned value. If the version string contains more than MAX_VERSION_COMPONENTS the remaining components are ignored.

CalculateVersion ( string versionString ) : long

Get a numeric version number. Each component is multiplied by VERSION_COMPONENT_MULTIPLIER^(MAX_VERSION_COMPONENTS - (component_index + 1)) and accumulated in the returned value. If the version string contains more than MAX_VERSION_COMPONENTS the remaining components are ignored.

FileMetadata ( string filename ) : UnityEngine

Parse metadata from filename and store in this class.

GetAssetImporter ( ) : AssetImporter

Get the AssetImporter associated with this file.

GetBuildTargets ( ) : HashSet

Get the list of build targets this file is compatible with.

GetEditorEnabled ( ) : bool

Determine whether this file is compatible with the editor. This is a special case as the editor isn't a "platform" covered by UnityEditor.BuildTarget.

RenameAsset ( string newFilename ) : bool

Rename the file associated with this data.

UpdateAssetLabels ( ) : void

Save metadata from this class into the asset's labels.

VersionNumberToString ( long versionNumber ) : string

Convert a numeric version back to a version string.

Private Methods

Method Description
GetBlackList ( ) : HashSet
GetUnityVersionMajorMinor ( ) : float
IsTargetSupportedByUnity ( BuildTarget target ) : bool
ParseTargets ( string token ) : string[]

Parse target names from a filename or label field.

ParseVersion ( string token ) : string

Parse version from a filename or label field.

Method Details

CalculateVersion() public method

Get a numeric version number. Each component is multiplied by VERSION_COMPONENT_MULTIPLIER^(MAX_VERSION_COMPONENTS - (component_index + 1)) and accumulated in the returned value. If the version string contains more than MAX_VERSION_COMPONENTS the remaining components are ignored.
public CalculateVersion ( ) : long
return long

CalculateVersion() public static method

Get a numeric version number. Each component is multiplied by VERSION_COMPONENT_MULTIPLIER^(MAX_VERSION_COMPONENTS - (component_index + 1)) and accumulated in the returned value. If the version string contains more than MAX_VERSION_COMPONENTS the remaining components are ignored.
public static CalculateVersion ( string versionString ) : long
versionString string
return long

FileMetadata() public method

Parse metadata from filename and store in this class.
public FileMetadata ( string filename ) : UnityEngine
filename string Name of the file to parse.
return UnityEngine

GetAssetImporter() public method

Get the AssetImporter associated with this file.
public GetAssetImporter ( ) : AssetImporter
return UnityEditor.AssetImporter

GetBuildTargets() public method

Get the list of build targets this file is compatible with.
public GetBuildTargets ( ) : HashSet
return HashSet

GetEditorEnabled() public method

Determine whether this file is compatible with the editor. This is a special case as the editor isn't a "platform" covered by UnityEditor.BuildTarget.
public GetEditorEnabled ( ) : bool
return bool

RenameAsset() public method

Rename the file associated with this data.
public RenameAsset ( string newFilename ) : bool
newFilename string New name of the file.
return bool

UpdateAssetLabels() public method

Save metadata from this class into the asset's labels.
public UpdateAssetLabels ( ) : void
return void

VersionNumberToString() public static method

Convert a numeric version back to a version string.
public static VersionNumberToString ( long versionNumber ) : string
versionNumber long
return string

Property Details

ASSET_LABEL public_oe static_oe property

Label which flags whether an asset is should be managed by this module.
public static string ASSET_LABEL
return string

BUILD_TARGET_NAME_TO_ENUM static_oe public_oe property

static public Dictionary BUILD_TARGET_NAME_TO_ENUM
return BuildTarget>.Dictionary

filename public_oe property

Name of the file use to construct this object.
public string filename
return string

filenameCanonical public_oe property

Name of the file with metadata stripped.
public string filenameCanonical
return string

isManifest public_oe property

Set if this references an asset manifest.
public bool isManifest
return bool

targets public_oe property

List of target platforms parsed from the filename.
public string[] targets
return string[]

versionString public_oe property

Version string parsed from the filename or AssetDatabase label if it's not present in the filename.
public string versionString
return string