using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Networking; using UnityEngine.UI; [ExecuteInEditMode] public class GetTexture2D : MonoBehaviour { public static string urlbase = "DeMa"; public string m_url = ""; void Start() { string filePath = System.IO.Path.Combine(Application.streamingAssetsPath+"/"+ urlbase, m_url); SetWebGLText.Instance.GetTexture(filePath+".png", (Texture2D t2d)=> { try { if (GetComponent()) GetComponent().texture = t2d; } catch { } }); } }