1234567891011121314151617181920212223242526272829 |
- 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<RawImage>())
- GetComponent<RawImage>().texture = t2d;
- }
- catch
- {
- }
- });
- }
- }
|