示例#1
0
 public void Play(AniElement elem, playtag tag, Action whenplay = null)
 {
     if (tag == playtag.play_immediate)
     {
         element_queue.Clear();
         curfstart  = elem.framestart;
         curfend    = elem.frameend;
         curelife   = elem.life;
         cureloop   = elem.loop;
         curframeid = 0;
         _data      = elem.ani;
         timer      = 0;
         instate    = false;
         if (whenplay != null)
         {
             whenplay();
         }
     }
     if (tag == playtag.play_afterthiselement)
     {
         element_queue.Clear();
         element_queue.Enqueue(elem);
         if (whenplay != null)
         {
             if (monitor == null)
             {
                 monitor = new Dictionary <AniElement, Action>();
             }
             monitor[elem] = whenplay;
         }
     }
     if (tag == playtag.play_wait)
     {
         element_queue.Enqueue(elem);
         if (whenplay != null)
         {
             if (monitor == null)
             {
                 monitor = new Dictionary <AniElement, Action>();
             }
             monitor[elem] = whenplay;
         }
     }
 }
示例#2
0
 public void Play(AniElement elem, playtag tag, Action whenplay = null)
 {
     if (tag == playtag.play_immediate)
     {
         element_queue.Clear();
         curfstart = elem.framestart;
         curfend = elem.frameend;
         curelife = elem.life;
         cureloop = elem.loop;
         curframeid = 0;
         _data = elem.ani;
         timer = 0;
         instate = false;
         if (whenplay != null)
             whenplay();
     }
     if (tag == playtag.play_afterthiselement)
     {
         element_queue.Clear();
         element_queue.Enqueue(elem);
         if (whenplay != null)
         {
             if (monitor == null) monitor = new Dictionary<AniElement, Action>();
             monitor[elem] = whenplay;
         }
     }
     if (tag == playtag.play_wait)
     {
         element_queue.Enqueue(elem);
         if (whenplay != null)
         {
             if (monitor == null) monitor = new Dictionary<AniElement, Action>();
             monitor[elem] = whenplay;
         }
     }
 }