12345678910111213141516171819 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.Networking;
- using UnityEngine.UI;
- [ExecuteInEditMode]
- public class GetTexture2D : MonoBehaviour
- {
- public string m_url = "";
- void Start()
- {
- string filePath = System.IO.Path.Combine(Application.streamingAssetsPath+"/ui", m_url);
- SetWebGLText.Instance.GetTexture(filePath+".png", (Texture2D t2d)=> {
- GetComponent<RawImage>().texture = t2d;
- },true);
- }
- }
|