// Start is called before the first frame update void Start() { food = GetComponentsInChildren <Text>()[0]; wood = GetComponentsInChildren <Text>()[1]; stone = GetComponentsInChildren <Text>()[2]; handler = RessourceHandler.getRessourceHandler(ress); }
public void DownloadAsync(DownloadInfo info, RessourceHandler <T> handler, CallbackHandler <T> callback) { _info = info; _handler = handler; _callback = callback; WebClient c = new WebClient(); c.DownloadDataCompleted += HandleDownloadCompleted; c.DownloadDataAsync(_info.Url); }
public void AcquireAsync(Uri ressource, RessourceHandler <T> handler, CallbackHandler <T> callback, DownloadInfo userArgs) { _info = userArgs; if (!string.IsNullOrEmpty(_info.Url.AbsolutePath)) { DownloadClient <T> webDL = new DownloadClient <T>(); webDL.DownloadAsync(_info, handler, callback); return; } throw new UriFormatException("URL cannot be null or empty"); }
public T Acquire(Uri ressource, DownloadInfo userArgs, RessourceHandler <T> handler) { _info = userArgs; if (!string.IsNullOrEmpty(_info.Url.AbsolutePath)) { DownloadClient <T> webDL = new DownloadClient <T>(); byte[] downloadedData = webDL.Download(_info); return(handler(downloadedData)); } throw new UriFormatException("URL connot be null or empty"); }