public void addPlayingCallback(TextureAnimCallBack callback, bool clear = true)
 {
     if (clear)
     {
         mPlayingCallback.Clear();
     }
     if (callback != null)
     {
         mPlayingCallback.Add(callback);
     }
 }
Exemplo n.º 2
0
    // 调用并且清空回调,清空是在调用之前
    protected void callAndClearEndCallback(bool isBreak)
    {
        TextureAnimCallBack curCallback = mPlayEndCallback;
        object curUserData = mPlayEndUserData;

        clearEndCallback();
        // 如果回调函数当前不为空,则是中断了更新
        if (curCallback != null)
        {
            curCallback(this, curUserData, isBreak);
        }
    }
Exemplo n.º 3
0
 public void addPlayEndCallback(TextureAnimCallBack callback, bool clear = true)
 {
     if (clear)
     {
         List <TextureAnimCallBack> curCallback = new List <TextureAnimCallBack>(mPlayEndCallback);
         mPlayEndCallback.Clear();
         // 如果回调函数当前不为空,则是中断了更新
         foreach (var item in curCallback)
         {
             item(this, true);
         }
     }
     mPlayEndCallback.Add(callback);
 }
 public void addPlayEndCallback(TextureAnimCallBack callback, bool clear = true)
 {
     if (clear)
     {
         List <TextureAnimCallBack> tempList = mListPool.newList(out tempList);
         tempList.AddRange(mPlayEndCallback);
         mPlayEndCallback.Clear();
         // 如果回调函数当前不为空,则是中断了更新
         foreach (var item in tempList)
         {
             item(this, true);
         }
         mListPool.destroyList(tempList);
     }
     mPlayEndCallback.Add(callback);
 }
Exemplo n.º 5
0
 public void addPlayEndCallback(TextureAnimCallBack callback, bool clear = true)
 {
     if (clear)
     {
         LIST(out List <TextureAnimCallBack> tempList);
         tempList.AddRange(mPlayEndCallback);
         mPlayEndCallback.Clear();
         // 如果回调函数当前不为空,则是中断了更新
         int count = tempList.Count;
         for (int i = 0; i < count; ++i)
         {
             tempList[i](this, true);
         }
         UN_LIST(tempList);
     }
     mPlayEndCallback.Add(callback);
 }
Exemplo n.º 6
0
 protected void clearEndCallback()
 {
     mPlayEndCallback = null;
     mPlayEndUserData = null;
 }
Exemplo n.º 7
0
 public void setPlayEndCallback(TextureAnimCallBack callback, object userData = null)
 {
     callAndClearEndCallback(true);
     mPlayEndCallback = callback;
     mPlayEndUserData = userData;
 }
Exemplo n.º 8
0
 public void addPlayingCallback(TextureAnimCallBack callback)
 {
     mPlayingCallback.Add(callback);
 }