Hi,
I want to have the same functionality as with Resources for StreamingAssets, but I’m stuck. I want to be able to say, just like with the Resources class:
public class TextureTest : MonoBehaviour
{
public void LoadTexture()
{
var texture = StreamingAssets.Load<Texture2D>("myTexture.png");
var renderer = GetComponent<Renderer>();
renderer.material.mainTexture = texture;
}
public IEnumerator LoadTextureAsync()
{
var request = StreamingAssets.LoadAsync<Texture2D>("myTexture.png");
yield return request;
var renderer = GetComponent<Renderer>();
renderer.material.mainTexture = (Texture2D)request.asset;
}
}
For reading from StreamingAssets, I need the WWW class on Android. The WWW class can only be used in a Coroutine. Now I would like to avoid having a singleton of a StreamingAssets MonoBehaviour in my scene. Is there maybe another way to read from the StreamingAssets folder on Android without WWW?
Thanks in advance,
Wavy