public static void ShowImage(string panelName, string url, GameObject go, bool isCacheInMemory, Action <int> callback) { if (!PanelManager._panelDict.ContainsKey(panelName)) { Logger.LogError("面板不存在, " + panelName); callback(-1); return; } if (go == null) { Logger.LogError("面板中指定的go不存在, " + panelName); callback(-3); return; } UITexture uiTexture = go.GetComponent <UITexture>(); if (uiTexture == null) { uiTexture = go.AddComponent <UITexture>(); } AssetManager.GetImage(url, isCacheInMemory, delegate(Texture2D texture) { PanelManager.OnGetImage(uiTexture, texture, url, callback); }); }
public static void ShowImage(string panelName, string url, UITexture uiTexture, bool isCacheInMemory, Action <int> callback) { if (!PanelManager._panelDict.ContainsKey(panelName)) { Logger.LogError("面板不存在, " + panelName); callback(-1); return; } if (uiTexture == null) { Logger.LogError("面板中指定的Image组件不存在, " + panelName); callback(-2); return; } AssetManager.GetImage(url, isCacheInMemory, delegate(Texture2D texture) { PanelManager.OnGetImage(uiTexture, texture, url, callback); }); }