protected override void Create(RenewableDownloadHandler handle) { Texture2D _texture; if (RenewablePool.Instance.Exist(cache, handle.key, handle.secret)) { _texture = RenewablePool.Instance.Pop <Texture2D>(cache, handle.key); } else { if (handle.source != null) { _texture = handle.Get <Texture2D>(); } else { _texture = new Texture2D(10, 10, TextureFormat.RGBA32, false); _texture.LoadImage(handle.buffer); } RenewablePool.Instance.Push(cache, handle.key, handle.secret, handle.recent, _texture); } if (this == null) { return; } if (current != handle.key) { return; } SetTexture(_texture); }
protected override void Create(RenewableDownloadHandler handle) { AudioClip clip = null; if (RenewablePool.Instance.Exist(cache, handle.key, handle.secret)) { clip = RenewablePool.Instance.Pop <AudioClip>(cache, handle.key); } else { if (handle.source != null) { clip = handle.Get <AudioClip>(); RenewablePool.Instance.Push(cache, handle.key, handle.secret, handle.recent, clip); } else { Debug.LogWarningFormat("{0} 无法解析!", handle.key); } } if (this == null) { return; } if (current != handle.key) { return; } Play(clip); }