Package net.risingworld.api.assets
Klasse PrefabAsset
java.lang.Object
net.risingworld.api.assets.Asset
net.risingworld.api.assets.PrefabAsset
Represents a prefab. A prefab may consist of several meshes. You can prepare a prefab in Unity, so it may also
contain custom materials (including custom shaders), lights, particle effects etc.
Supported file formats: zip, fbx, obj, stl, ply, 3mf, gltf
Supported file formats: zip, fbx, obj, stl, ply, 3mf, gltf
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen net.risingworld.api.assets.Asset
Asset.Source, Asset.Type
-
Feldübersicht
Von Klasse geerbte Felder net.risingworld.api.assets.Asset
DEFAULT_EXTENSION
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic PrefabAsset
loadFromAssetBundle
(AssetBundle bundle, String path) Loads a prefab from an AssetBundle.static PrefabAsset
loadFromFile
(String file) Loads a prefab from a file.static PrefabAsset
loadFromFile
(String file, ModelImportSettings settings) Loads a prefab from a file.static PrefabAsset
loadFromGame
(String path) Loads a prefab from the game assets.Von Klasse geerbte Methoden net.risingworld.api.assets.Asset
dispose, equals, getChecksum, getDependency, getExtension, getHandle, getPath, getSource, getType, hashCode, isDisposed
-
Methodendetails
-
loadFromGame
Loads a prefab from the game assets. This is quite efficient because the server doesn't have to send any data to the clients.
To get the prefab asset paths of game items, you could check out the various tables in the definitions.db file (in Data/StreamingAsets/). Alternatively get the asset path from theDefinitions
via API.- Parameter:
path
- the path to the game prefab.- Gibt zurück:
- a new prefab asset instance.
- Example: Load pickaxe from game files using hard-coded path
- Example: Load pickaxe from game files using definition
-
loadFromAssetBundle
Loads a prefab from an AssetBundle.- Parameter:
bundle
- the asset bundle you want to load the prefab from.path
- the path in the asset bundle.- Gibt zurück:
- a new prefab asset instance.
-
loadFromFile
Loads a prefab from a file. This could be an fbx, obj or any other model file. If your model contains any textures you want to load automatically, it's recommended to put them into a zip file (together with the model file) and load the zip file.- Parameter:
file
- the path to the model file.- Gibt zurück:
- a new prefab asset instance.
-
loadFromFile
Loads a prefab from a file. This could be an fbx, obj or any other model file. If your model contains any textures you want to load automatically, it's recommended to put them into a zip file (together with the model file) and load the zip file.- Parameter:
file
- the path to the model file.settings
- a settings object which enables you to influence how the model should be loaded.- Gibt zurück:
- a new prefab asset instance.
-