Thanks for your hints but it doesn´t work.
My code is that:
class StreamAssetBundle{
public function StreamAssetBundle () {
print("StreamAssetBundle" );
}
static public function StartDownload () {
print("Start" );
}
}
Maybe someone could check it. Would be nice. Thanks a lot.
Like Andeeeeeeeeeee said, you don’t seem to have initialized the “stream” variable. You’ve declared it, but done nothing else, hence it is null. Unless there’s more code you haven’t shown.
function OnGUI()
{
if (GUILayout.Button("... start DL" )){
var stream : StreamAssetBundle= gameObject.AddComponent(StreamAssetBundle) as StreamAssetBundle;
stream.StartDownload();
}
}