|
@@ -24,7 +24,7 @@ public class ShowXunJian_UIItem : MonoBehaviour, IController
|
|
|
|
|
|
[SerializeField] private GameObject mErrorBtn_go;
|
|
[SerializeField] private GameObject mErrorBtn_go;
|
|
|
|
|
|
- private List<Image> ScreenshotList;
|
|
|
|
|
|
+ public List<Image> ScreenshotList;
|
|
|
|
|
|
private void Start()
|
|
private void Start()
|
|
{
|
|
{
|
|
@@ -53,9 +53,10 @@ public class ShowXunJian_UIItem : MonoBehaviour, IController
|
|
|
|
|
|
foreach (var ByteClass in byteDic)
|
|
foreach (var ByteClass in byteDic)
|
|
{
|
|
{
|
|
- Debug.LogError($"是否上传:{ByteClass.Value.upload}");
|
|
|
|
|
|
+ //Debug.LogError($"是否上传:{ByteClass.Value.upload}");
|
|
if (ByteClass.Value.upload)
|
|
if (ByteClass.Value.upload)
|
|
{
|
|
{
|
|
|
|
+ byteDic[ByteClass.Key].upload = false;
|
|
LangChaoMinIo.Instance.saveFile(ByteClass.Value.bytes,
|
|
LangChaoMinIo.Instance.saveFile(ByteClass.Value.bytes,
|
|
this.GetService<IInspectionService>().InspectionInfo.id,
|
|
this.GetService<IInspectionService>().InspectionInfo.id,
|
|
mItemID.ToString(),
|
|
mItemID.ToString(),
|
|
@@ -75,15 +76,10 @@ public class ShowXunJian_UIItem : MonoBehaviour, IController
|
|
Dictionary<int, ByteClass> byteDic = new Dictionary<int, ByteClass>();
|
|
Dictionary<int, ByteClass> byteDic = new Dictionary<int, ByteClass>();
|
|
public void ChangeSprite(int id, Texture2D Texture2D)
|
|
public void ChangeSprite(int id, Texture2D Texture2D)
|
|
{
|
|
{
|
|
- Debug.LogError($"ID:{id}");
|
|
|
|
if (byteDic.ContainsKey(id))
|
|
if (byteDic.ContainsKey(id))
|
|
- {
|
|
|
|
byteDic[id] = new ByteClass() { upload = true, bytes = Texture2D.EncodeToPNG() };
|
|
byteDic[id] = new ByteClass() { upload = true, bytes = Texture2D.EncodeToPNG() };
|
|
- }
|
|
|
|
else
|
|
else
|
|
- {
|
|
|
|
byteDic.Add(id, new ByteClass() { upload = true, bytes = Texture2D.EncodeToPNG() });
|
|
byteDic.Add(id, new ByteClass() { upload = true, bytes = Texture2D.EncodeToPNG() });
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public void InitData(int ItemID, int InspectionId, InspectionStep InspectionStep = null)
|
|
public void InitData(int ItemID, int InspectionId, InspectionStep InspectionStep = null)
|
|
@@ -102,17 +98,18 @@ public class ShowXunJian_UIItem : MonoBehaviour, IController
|
|
mOutliers = InspectionStep.outliers;
|
|
mOutliers = InspectionStep.outliers;
|
|
}
|
|
}
|
|
|
|
|
|
- for (int i = 0; i < InspectionStep.images.Length; i++)
|
|
|
|
|
|
+ int current = 0;
|
|
|
|
+ for (int i = 0; i < 3; i++)
|
|
{
|
|
{
|
|
- Debug.LogError("getFile");
|
|
|
|
- LangChaoMinIo.Instance.getFile(this.GetService<IInspectionService>().InspectionInfo.id, mItemID.ToString(), InspectionStep.images[i], Texture2D =>
|
|
|
|
|
|
+ LangChaoMinIo.Instance.getFile(this.GetService<IInspectionService>().InspectionInfo.id, mItemID.ToString(), i, Texture2D =>
|
|
{
|
|
{
|
|
if (Texture2D != null)
|
|
if (Texture2D != null)
|
|
{
|
|
{
|
|
- byteDic.Add(i, new ByteClass() { upload = false, bytes = Texture2D.EncodeToPNG() });
|
|
|
|
|
|
+ byteDic.Add(current, new ByteClass() { upload = false, bytes = Texture2D.EncodeToPNG() });
|
|
Sprite sprite = Sprite.Create(Texture2D, new Rect(0, 0, Texture2D.width, Texture2D.height), Vector2.zero);
|
|
Sprite sprite = Sprite.Create(Texture2D, new Rect(0, 0, Texture2D.width, Texture2D.height), Vector2.zero);
|
|
- ScreenshotList[i].sprite = sprite;
|
|
|
|
- Destroy(Texture2D);
|
|
|
|
|
|
+ sprite.name = current.ToString();
|
|
|
|
+ ScreenshotList[current].sprite = sprite; current++;
|
|
|
|
+ //Destroy(Texture2D);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|