|
|
|
|
|
|
volatile int _repetitionCount; |
|
|
|
volatile bool _isDone; |
|
|
|
volatile int _frameIndex; |
|
|
|
volatile Texture2D _texture; |
|
|
|
readonly UIWidgetsCoroutine _coroutine; |
|
|
|
|
|
|
|
public GifCodec(byte[] bytes) { |
|
|
|
|
|
|
return frame.Then(frameData => { |
|
|
|
this._nextFrame(); |
|
|
|
|
|
|
|
if (frameData.frameInfo != null) { |
|
|
|
return frameData.frameInfo; |
|
|
|
if (this._texture == null) { |
|
|
|
this._texture = new Texture2D(this._width, this._height, TextureFormat.BGRA32, false); |
|
|
|
this._texture.hideFlags = HideFlags.HideAndDontSave; |
|
|
|
var tex = new Texture2D(this._width, this._height, TextureFormat.BGRA32, false); |
|
|
|
tex.hideFlags = HideFlags.HideAndDontSave; |
|
|
|
var tex = this._texture; |
|
|
|
if (frameData.frameInfo != null) { |
|
|
|
return frameData.frameInfo; |
|
|
|
} |
|
|
|
|
|
|
|
frameData.gifFrame = null; // dispose gifFrame
|
|
|
|
// frameData.gifFrame = null; // dispose gifFrame
|
|
|
|
|
|
|
|
return frameData.frameInfo; |
|
|
|
}); |
|
|
|