What is wrong the with the code here?

  • Thread starter Aurora Billesbach
  • Start date
A

Aurora Billesbach

Guest
Right now, I am trying to build an app for iOS; it is dealing with textures using powerful tools and size of the image is 6MB (it is png). I am getting Amazon S3 server; I am getting in the form of a stream or from any device. With those 2 cases, I don't have any problem. With raw data, I am sending a direct request to the server and getting the stream easily. With second, I am using file transfer protocol with texture available. I am facing an issue while copying data to Texture2D (I am thinking about using) as a Texture2D. While handling the stream, I am converting this data into byte[] formation. After that, I am using LoadImage() file. With the direct download, I am copying with current = www.texture. This result in huge amount of output data in the form of simple texture, which I am loading or copying.

The problem (#2) is also with framing out, which is un-shippable in the case. Here is the concerned code:

Code:
using (var getting_data = responseStream)
 {   byte[] byteinfo = ToByteArray(getting_data);
   current.LoadImage(byteinfo);  
// Only to get the binary data } 
... WWW info = new WWW("file://" + filePath);
 yield return info; current = www.texture;

Simple removal of frames removal Unfortunately, Unity doesn't seem to like running these operations on a separate thread from the main thread and throws an exception when I try. Can I use multiple frames to divide the operations into two halves? Or Is there a fast memory transfer operation, which will not disturb the main running thread? I have already tried processes like LoadImageIntoTexture function of WWW operation (but it is resulting in clustering). Then I have tried with textureNonReadable variable settings, but it is providing short-mimic-responses. Next, I worked with Graphics.CopyTexture, but this is only taking me to copying operations rather than a transfer of data. This program is part of a big development project, which I am working with. I am trying to get data from an online server; this data will be incorporated as inputs to AI algorithm. That algo will be acting will be performing the testing and providing adequate results in the form of a tabular 1000x10 array. That output will be use to improve the user experience. Right now, I am working with http://unturneditemid.com, which contain users and items information in the form of plain text (means it is easy to get from there). This data is just a test object & after it is done, it will be part of real-time gaming scenario.