Package net.risingworld.api.assets
Class Asset
java.lang.Object
net.risingworld.api.assets.Asset
- Direct Known Subclasses:
AssetBundle
,MaterialAsset
,MeshAsset
,ModelAsset
,ModelImportSettings
,PrefabAsset
,SoundAsset
,StyleSheetAsset
,TextureAsset
Abstract base class representing a reference to an asset.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The asset source, i.e where it is loaded fromstatic enum
The asset type -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
dispose()
Disposes the asset, i.e frees all resources.boolean
Gets the checksum of this asset.int
Gets the asset extension.int
Gets the internal handle of this asset.getPath()
Gets the path to the asset.getType()
int
hashCode()
boolean
Gets whether or not the asset is already disposed (i.e the resources are released).
-
Field Details
-
DEFAULT_EXTENSION
- See Also:
-
-
Method Details
-
getHandle
public int getHandle()Gets the internal handle of this asset.- Returns:
- the internal handle (ID).
-
getSource
-
getType
-
getDependency
public int getDependency() -
getPath
Gets the path to the asset.- Returns:
- the path to the asset.
-
getExtension
Gets the asset extension. Usually this is only relevant for files loaded from the hard drive.- Returns:
- the asset extension.
-
getChecksum
Gets the checksum of this asset.- Returns:
- the MD5 checksum, as a String.
-
isDisposed
public boolean isDisposed()Gets whether or not the asset is already disposed (i.e the resources are released). Never use disposed assets!- Returns:
- true if the asset is already disposed, false if not.
-
dispose
public boolean dispose()Disposes the asset, i.e frees all resources. Call this method if you no longer need this asset.- Returns:
- true if the asset was valid and found on native side, false if not.
-
equals
-
hashCode
public int hashCode()
-