You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to change the texture of an object using an image from the Internet, using the UnityWebRequestTexture API.
The scene works perfectly in the editor, but when I try it in the sandbox online, the code cannot recognize the method for the WebRequestTexture.
When I check the code in VS it says "RS0030 The symbol has been flagged for possible banning in this project; please contact Spatial if you would like to continue using this API."
Here is the code:
using System.Collections;
using UnityEngine;
using UnityEngine.Networking;
public class WebRequestImage : MonoBehaviour
{
[SerializeField] private MeshRenderer Screen;
[SerializeField] private string ImageLink;
public void Interact() //interaction input
{
Debug.Log("Input recived...");
StartCoroutine(LoadImage(ImageLink));
}
IEnumerator LoadImage(string link)
{
UnityWebRequest request = UnityWebRequestTexture.GetTexture(link);
yield return request.SendWebRequest();
if (request.result != UnityWebRequest.Result.Success)
{
Debug.Log(request.error);
}
else
{
Screen.material.SetTexture("_ImageTexture", DownloadHandlerTexture.GetContent(request));
Debug.Log("Image Loaded");
}
}
}
Do you know if this API is experimental for Spatial?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
I'm trying to change the texture of an object using an image from the Internet, using the UnityWebRequestTexture API.
The scene works perfectly in the editor, but when I try it in the sandbox online, the code cannot recognize the method for the WebRequestTexture.
When I check the code in VS it says "RS0030 The symbol has been flagged for possible banning in this project; please contact Spatial if you would like to continue using this API."
Here is the code:
Do you know if this API is experimental for Spatial?
All reactions