Commit 90ad191d authored by 神楽坂玲奈's avatar 神楽坂玲奈

fix

parent 710dd43b
...@@ -1429,10 +1429,8 @@ public class gameCard : OCGobject ...@@ -1429,10 +1429,8 @@ public class gameCard : OCGobject
private async void LoadCard() private async void LoadCard()
{ {
Debug.Log(data.Id); gameObject_face.GetComponent<Renderer>().material.mainTexture = await GameTextureManager.GetCardPicture(data.Id,
gameObject_face.GetComponent<Renderer>().material.mainTexture = p.controller == 0 ? GameTextureManager.myBack : GameTextureManager.opBack);
await GameTextureManager.GetCardPicture(data.Id) ??
(p.controller == 0 ? GameTextureManager.myBack : GameTextureManager.opBack);
if (game_object_verticle_drawing) if (game_object_verticle_drawing)
game_object_verticle_drawing.GetComponent<Renderer>().material.mainTexture = game_object_verticle_drawing.GetComponent<Renderer>().material.mainTexture =
await GameTextureManager.GetCardCloseUp(data.Id); await GameTextureManager.GetCardCloseUp(data.Id);
......
...@@ -79,9 +79,14 @@ public class GameTextureManager ...@@ -79,9 +79,14 @@ public class GameTextureManager
private static readonly Dictionary<int, Task<Texture2D>> loadedCloseUp = new(); private static readonly Dictionary<int, Task<Texture2D>> loadedCloseUp = new();
private static readonly Dictionary<string, Texture2D> loadedUI = new(); private static readonly Dictionary<string, Texture2D> loadedUI = new();
public static async Task<Texture2D> GetCardPicture(int code) public static Task<Texture2D> GetCardPicture(int code)
{ {
if (code == 0) return null; return GetCardPicture(code, myBack);
}
public static async Task<Texture2D> GetCardPicture(int code, Texture2D zero)
{
if (code == 0) return zero;
if (loadedPicture.TryGetValue(code, out var cached)) return await cached; if (loadedPicture.TryGetValue(code, out var cached)) return await cached;
foreach (var extname in new[] {".png", ".jpg"}) foreach (var extname in new[] {".png", ".jpg"})
{ {
...@@ -94,7 +99,7 @@ public class GameTextureManager ...@@ -94,7 +99,7 @@ public class GameTextureManager
} }
} }
return null; return unknown;
} }
public static async Task<Texture2D> GetCardCloseUp(int code) public static async Task<Texture2D> GetCardCloseUp(int code)
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!387306366 &1
MemorySettings:
m_ObjectHideFlags: 0
m_EditorMemorySettings:
m_MainAllocatorBlockSize: -1
m_ThreadAllocatorBlockSize: -1
m_MainGfxBlockSize: -1
m_ThreadGfxBlockSize: -1
m_CacheBlockSize: -1
m_TypetreeBlockSize: -1
m_ProfilerBlockSize: -1
m_ProfilerEditorBlockSize: -1
m_BucketAllocatorGranularity: -1
m_BucketAllocatorBucketsCount: -1
m_BucketAllocatorBlockSize: -1
m_BucketAllocatorBlockCount: -1
m_ProfilerBucketAllocatorGranularity: -1
m_ProfilerBucketAllocatorBucketsCount: -1
m_ProfilerBucketAllocatorBlockSize: -1
m_ProfilerBucketAllocatorBlockCount: -1
m_TempAllocatorSizeMain: -1
m_JobTempAllocatorBlockSize: -1
m_BackgroundJobTempAllocatorBlockSize: -1
m_JobTempAllocatorReducedBlockSize: -1
m_TempAllocatorSizeGIBakingWorker: -1
m_TempAllocatorSizeNavMeshWorker: -1
m_TempAllocatorSizeAudioWorker: -1
m_TempAllocatorSizeCloudWorker: -1
m_TempAllocatorSizeGfx: -1
m_TempAllocatorSizeJobWorker: -1
m_TempAllocatorSizeBackgroundWorker: -1
m_TempAllocatorSizePreloadManager: -1
m_PlatformMemorySettings: {}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment