|
@@ -13,39 +13,49 @@ public class PngJpgItem : BaseFilePrefabItem
|
|
{
|
|
{
|
|
base.Init(fileConfig);
|
|
base.Init(fileConfig);
|
|
|
|
|
|
- LangChaoRommMinIo.Instance.getFile(MQTTManager.Instance.roomId, fileConfig.Bucket, fileConfig.ObjectName, (RoomFileData rfd) => {
|
|
|
|
|
|
+ //LangChaoRommMinIo.Instance.getFile(MQTTManager.Instance.roomId, fileConfig.Bucket, fileConfig.ObjectName, (RoomFileData rfd) => {
|
|
|
|
|
|
- Debug.Log("rfd==>" + rfd.url);
|
|
|
|
- Debug.Log("rfd==>" + rfd.bytes.Length);
|
|
|
|
|
|
+ // Debug.Log("rfd==>" + rfd.url);
|
|
|
|
+ // Debug.Log("rfd==>" + rfd.bytes.Length);
|
|
|
|
|
|
- Texture2D texture = new Texture2D(10, 10);
|
|
|
|
- texture.LoadImage(rfd.bytes);//流数据转换成Texture2D
|
|
|
|
|
|
+ // Texture2D texture = new Texture2D(10, 10);
|
|
|
|
+ // texture.LoadImage(rfd.bytes);//流数据转换成Texture2D
|
|
|
|
|
|
- texture.Apply();
|
|
|
|
|
|
+ // texture.Apply();
|
|
|
|
|
|
- Adaption(texture);
|
|
|
|
- mainImage.texture = texture;
|
|
|
|
- });
|
|
|
|
|
|
+ // Adaption(texture);
|
|
|
|
+ // mainImage.texture = texture;
|
|
|
|
+ //});
|
|
|
|
|
|
|
|
|
|
- //if (!string.IsNullOrEmpty(fileConfig.Url))
|
|
|
|
- //{
|
|
|
|
- // string url = fileConfig.Url;
|
|
|
|
- // if (!fileConfig.Url.Contains("http"))
|
|
|
|
- // {
|
|
|
|
- // url = "https://" + fileConfig.Url;
|
|
|
|
- // }
|
|
|
|
- // NetWorkHeaders.Instance.getNetTexture(url, null, (Texture tex) => {
|
|
|
|
- // if (tex)
|
|
|
|
- // {
|
|
|
|
- // Adaption(tex);
|
|
|
|
- // mainImage.texture = tex;
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
|
|
+ if (!string.IsNullOrEmpty(fileConfig.Url))
|
|
|
|
+ {
|
|
|
|
+ string url = fileConfig.Url;
|
|
|
|
|
|
|
|
+ LangChaoRommMinIo.Instance.getFile(MQTTManager.Instance.roomId, fileConfig.Bucket, fileConfig.ObjectName, (RoomFileData rfd) => {
|
|
|
|
|
|
- //}
|
|
|
|
- }
|
|
|
|
|
|
+ Debug.Log("rfd==>" + rfd.url);
|
|
|
|
+ Debug.Log("rfd==>" + rfd.bytes.Length);
|
|
|
|
+ url = rfd.url;
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ if (!fileConfig.Url.Contains("http"))
|
|
|
|
+ {
|
|
|
|
+ url = "https://" + fileConfig.Url;
|
|
|
|
+ }
|
|
|
|
+ NetWorkHeaders.Instance.getNetTexture(url, null, (Texture tex) =>
|
|
|
|
+ {
|
|
|
|
+ if (tex)
|
|
|
|
+ {
|
|
|
|
+ Adaption(tex);
|
|
|
|
+ mainImage.texture = tex;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
public void Adaption(Texture tex)
|
|
public void Adaption(Texture tex)
|
|
{
|
|
{
|