早上提交

This commit is contained in:
2274240467@qq.com 2025-11-07 08:49:22 +08:00
parent 026ef33276
commit e63afd2719
3 changed files with 30 additions and 12 deletions

View File

@ -44099,7 +44099,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &822021582
RectTransform:
m_ObjectHideFlags: 0
@ -44184,7 +44184,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 2f1ccfa62d041a84da37034d725cb6a8, type: 3}
m_Sprite: {fileID: 21300000, guid: 10c807616459bc34fb5a3833c7535928, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
@ -90955,7 +90955,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &1589317998
RectTransform:
m_ObjectHideFlags: 0
@ -91040,7 +91040,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 06a248894c8e41944ac266cb317ffc54, type: 3}
m_Sprite: {fileID: 21300000, guid: 4e674e9115b77774f9cc9c50f4eada59, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1

View File

@ -15,6 +15,13 @@ public enum LookAtCameraName
,
,
,
,
,
,
,
,
,
,
,
,

View File

@ -161,22 +161,22 @@ public class Manager : MonoBehaviour
}
}
# region
# region
/// <summary>
/// 加载台账界面
/// </summary>
/// <param name="ShowImage"></param>
/// <param name="LedgerImage"></param>
/// <param name="path"></param>
public void LoadLedgerFromResources(GameObject showImage ,Image LedgerImage ,Button CloesBtn,string path)
public void LoadLedgerFromResources(GameObject ShowImage ,Image LedgerImage ,Button CloesBtn,string path)
{
showImage.SetActive(true);
ShowImage.SetActive(true);
Sprite[] loadedSprites = Resources.LoadAll<Sprite>(path);
if (loadedSprites == null || loadedSprites.Length == 0)
{
Debug.LogError($"路径 {path} 中未找到任何Sprite");
showImage.SetActive(false);
Debug.LogError($"路径 {path} 中未找到任何Sprite文件夹中没图片");
ShowImage.SetActive(false);
return;
}
@ -195,7 +195,7 @@ public class Manager : MonoBehaviour
CloesBtn.onClick.AddListener(() =>
{
bookPages?.Clear();
showImage.SetActive(false);
ShowImage.SetActive(false);
Debug.Log("台账面板已关闭bookPages 列表已清空");
});
}
@ -209,6 +209,11 @@ public class Manager : MonoBehaviour
{
currentPage--;
UpDatePageDisplay();
// if (currentPage == 1)
// {
// NextOrPrevBtn[0].gameObject.SetActive(false);
// NextOrPrevBtn[1].gameObject.SetActive(true);
// }
}
}
/// <summary>
@ -221,6 +226,11 @@ public class Manager : MonoBehaviour
{
currentPage++;
UpDatePageDisplay();
// if (currentPage == bookPages.Count)
// {
// NextOrPrevBtn[0].gameObject.SetActive(true);
// NextOrPrevBtn[1].gameObject.SetActive(false);
// }
}
}
/// <summary>
@ -231,16 +241,17 @@ public class Manager : MonoBehaviour
Debug.Log(bookPages.Count);
if (currentPage >= 1 && currentPage <= bookPages.Count)
{
// 相当于原来的 "bookPages[currentPage - 1].SetActive(true)"
LedgerImage.sprite = bookPages[currentPage - 1];
LedgerImage.gameObject.SetActive(true);
Debug.Log($"显示第 {currentPage} 页,共 {bookPages.Count} 页");
}
else
{
// 如果页码无效,隐藏显示
Debug.Log("当前文件夹内为空");
LedgerImage.gameObject.SetActive(false);
}
NextOrPrevBtn[0].gameObject.SetActive(currentPage > 1); // 上一页
NextOrPrevBtn[1].gameObject.SetActive(currentPage < bookPages.Count); // 下一页
}
#endregion
}