API
Static methods
staticbind(path:String, object:Dynamic):Void
Load the Prefab from path
and assign all created hierarchy objects to
fields of the object
instance.
Parameters:
path |
Prefab name. Can point to a subfolder and must be without an extension. |
---|---|
object |
An instance to which the prefab adds itself and assigns fields from the
loaded |
staticload(path:String, ?parent:Object, ?field:Array<Field>):Prefab
Load the Prefab with the given name path
from the res
folder.
path
can point to a subfolder (eg: "ui/button") and must be without an
extension.
Parameters:
path |
Prefab name. |
---|---|
parent |
An optional parent
|
field |
An optional |
staticmake(path:String, type:Class<Dynamic>, ?parent:Object):Dynamic
Create a Prefab with a given class type
, load data from
path
and assign all created hierarchy objects to fields of this
instance.
Parameters:
path |
Prefab name. Can point to a subfolder and must be without an extension. |
---|---|
type |
Prefab class. All objects from the loaded hierarchy will be assigned to the fields of this instance. |
parent |
An optional parent
|