瀏覽代碼

图片也临时塞上去

Void_F 9 月之前
父節點
當前提交
40f3395c4c

+ 12 - 90
Assets/Prefabs/UI/3D/GCZL.prefab

@@ -2478,9 +2478,9 @@ GameObject:
   m_Component:
   - component: {fileID: 6806418906904679555}
   - component: {fileID: 7937864342652152357}
-  - component: {fileID: 6272157016354013629}
+  - component: {fileID: 642218551406745}
   m_Layer: 0
-  m_Name: MPImage
+  m_Name: fm
   m_TagString: Untagged
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
@@ -2514,7 +2514,7 @@ CanvasRenderer:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 4996499399882371602}
   m_CullTransparentMesh: 1
---- !u!114 &6272157016354013629
+--- !u!114 &642218551406745
 MonoBehaviour:
   m_ObjectHideFlags: 0
   m_CorrespondingSourceObject: {fileID: 0}
@@ -2523,102 +2523,24 @@ MonoBehaviour:
   m_GameObject: {fileID: 4996499399882371602}
   m_Enabled: 1
   m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 141109fb25f0083469e71ce8cb3e75c8, type: 3}
+  m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
   m_Material: {fileID: 0}
-  m_Color: {r: 0.7647059, g: 0.7647059, b: 0.7647059, a: 1}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
   m_RaycastTarget: 1
   m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
   m_Maskable: 1
   m_OnCullStateChanged:
     m_PersistentCalls:
       m_Calls: []
-  m_Sprite: {fileID: 0}
-  m_Type: 0
-  m_PreserveAspect: 0
-  m_FillCenter: 1
-  m_FillMethod: 4
-  m_FillAmount: 1
-  m_FillClockwise: 1
-  m_FillOrigin: 0
-  m_UseSpriteMesh: 0
-  m_PixelsPerUnitMultiplier: 1
-  m_DrawShape: 3
-  m_ImageType: 0
-  m_MaterialMode: 0
-  m_StrokeWidth: 0
-  m_OutlineWidth: 1
-  m_OutlineColor: {r: 0.3647059, g: 0.4117647, b: 0.53333336, a: 0.101960786}
-  m_FalloffDistance: 0.5
-  m_ConstrainRotation: 1
-  m_ShapeRotation: 0
-  m_FlipHorizontal: 0
-  m_FlipVertical: 0
-  m_Triangle:
-    m_CornerRadius: {x: 0, y: 0, z: 0}
-    m_UniformCornerRadius: 0
-  m_Rectangle:
-    m_CornerRadius: {x: 0, y: 0, z: 0, w: 0}
-    m_UniformCornerRadius: 1
-  m_Circle:
-    m_Radius: 0
-    m_FitRadius: 0
-  m_Pentagon:
-    m_CornerRadius: {x: 0, y: 0, z: 0, w: 0}
-    m_UniformCornerRadius: 0
-    m_TipRadius: 0.001
-    m_TipSize: 1
-  m_Hexagon:
-    m_CornerRadius: {x: 1, y: 1, z: 1, w: 1}
-    m_UniformCornerRadius: 0
-    m_TipSize: {x: 1, y: 1}
-    m_UniformTipSize: 0
-    m_TipRadius: {x: 1, y: 1}
-    m_UniformTipRadius: 0
-  m_NStarPolygon:
-    m_SideCount: 3
-    m_Inset: 2
-    m_CornerRadius: 0
-    m_Offset: {x: 0, y: 0}
-  m_GradientEffect:
-    m_Enabled: 0
-    m_GradientType: 0
-    m_Gradient:
-      serializedVersion: 2
-      key0: {r: 1, g: 1, b: 1, a: 1}
-      key1: {r: 1, g: 1, b: 1, a: 1}
-      key2: {r: 0, g: 0, b: 0, a: 0}
-      key3: {r: 0, g: 0, b: 0, a: 0}
-      key4: {r: 0, g: 0, b: 0, a: 0}
-      key5: {r: 0, g: 0, b: 0, a: 0}
-      key6: {r: 0, g: 0, b: 0, a: 0}
-      key7: {r: 0, g: 0, b: 0, a: 0}
-      ctime0: 0
-      ctime1: 65535
-      ctime2: 0
-      ctime3: 0
-      ctime4: 0
-      ctime5: 0
-      ctime6: 0
-      ctime7: 0
-      atime0: 0
-      atime1: 65535
-      atime2: 0
-      atime3: 0
-      atime4: 0
-      atime5: 0
-      atime6: 0
-      atime7: 0
-      m_Mode: 0
-      m_NumColorKeys: 2
-      m_NumAlphaKeys: 2
-    m_CornerGradientColors:
-    - {r: 0, g: 0, b: 0, a: 0}
-    - {r: 0, g: 0, b: 0, a: 0}
-    - {r: 0, g: 0, b: 0, a: 0}
-    - {r: 0, g: 0, b: 0, a: 0}
-    m_Rotation: 0
+  m_Texture: {fileID: 0}
+  m_UVRect:
+    serializedVersion: 2
+    x: 0
+    y: 0
+    width: 1
+    height: 1
 --- !u!1 &5132896106310301295
 GameObject:
   m_ObjectHideFlags: 0

+ 1 - 1
Assets/Prefabs/UI/Information.prefab

@@ -141,7 +141,7 @@ GameObject:
   - component: {fileID: 5528671915140540344}
   - component: {fileID: 5528671915140540345}
   m_Layer: 5
-  m_Name: RawImage
+  m_Name: fm
   m_TagString: Untagged
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0

文件差異過大導致無法顯示
+ 2 - 99
Assets/Scene 1.unity


+ 25 - 0
Assets/Scripts/TextureLoadHelp.cs

@@ -22,6 +22,31 @@ public class TextureLoadHelp : MonoBehaviour
     private Dictionary<string, int> loadingABList;
 
     public Texture map_def;
+    
+    //临时存的封面图
+    public Texture[] tempTextures;
+    public string[] tempTextureName;
+
+    public Texture GetTempTexture(string name)
+    {
+        int index = -1;
+        for (int i = 0; i < tempTextureName.Length; i++)
+        {
+            if (tempTextureName[i].Equals(name))
+            {
+                index = i;
+                break;
+            }
+        }
+        if (index != -1)
+        {
+            return tempTextures[index];
+        }
+        else
+        {
+            return null;
+        }
+    }
 
     private void Awake()
     {

+ 7 - 2
Assets/Scripts/UI/UIView/3D/GCZLLayer.cs

@@ -31,6 +31,7 @@ public class GCZLLayer : MonoBehaviour
     private Text InfoClassText;
     private Text InfoNoText;
     private Text InfoDayText;
+    private RawImage InfoFM;
 
     private GameObject DetailPanel;
     private Button DetailExitButton;
@@ -45,6 +46,7 @@ public class GCZLLayer : MonoBehaviour
         InfoClassText= InfoPanel.transform.Find("Class").GetComponent<Text>();
         InfoNoText= InfoPanel.transform.Find("No").GetComponent<Text>();
         InfoDayText= InfoPanel.transform.Find("Day").GetComponent<Text>();
+        InfoFM = InfoPanel.transform.Find("fm").GetComponent<RawImage>();
         InfoExitButton = InfoPanel.transform.Find("CloseButton").GetComponent<Button>();
         InfoExitButton.onClick.AddListener(() =>
         {
@@ -130,7 +132,8 @@ public class GCZLLayer : MonoBehaviour
                     //todo
                     obj.transform.Find("No").GetComponentInChildren<Text>().text = "未知";
                     obj.transform.Find("Day").GetComponentInChildren<Text>().text = "近期";
-
+                    obj.transform.Find("fm").GetComponent<RawImage>().texture =
+                        TextureLoadHelp._Instance.GetTempTexture(priName);
                     obj.transform.localScale = Vector3.one;
                     informations.Add(obj);
                     int dataIndex = i;
@@ -169,7 +172,8 @@ public class GCZLLayer : MonoBehaviour
                     //todo
                     obj.transform.Find("No").GetComponentInChildren<Text>().text = "未知";
                     obj.transform.Find("Day").GetComponentInChildren<Text>().text = "近期";
-
+                    obj.transform.Find("fm").GetComponent<RawImage>().texture =
+                        TextureLoadHelp._Instance.GetTempTexture(priName);
                     obj.transform.localScale = Vector3.one;
                     informations.Add(obj);
                     int dataIndex = i;
@@ -205,6 +209,7 @@ public class GCZLLayer : MonoBehaviour
     {
         InfoTitleText.text = currentData.name;
         InfoClassText.text = currentData.GetTypeName();
+        InfoFM.texture = TextureLoadHelp._Instance.GetTempTexture(currentData.name_pri);
         //todo
         InfoNoText.text = "未知";
         InfoDayText.text = "近期";

部分文件因文件數量過多而無法顯示