示例#1
0
        public int frameend;   //结束帧

        public object Clone()
        {
            AniElement newobj = new AniElement(this.ani, this.framestart, this.frameend, this.loop);

            newobj.life = this.life;
            return(newobj);
        }
示例#2
0
 public SpriteAniController(AniElement state)
 {
     //this.data = data;
     this.element_state = state;
     this._data         = state.ani;
     if (element_state != null)
     {
         curfstart  = element_state.framestart;
         curfend    = element_state.frameend;
         cureloop   = element_state.loop;
         _data      = element_state.ani;
         curframeid = 0;
         timer      = 0;
     }
     this.bplay     = true;
     instate        = true;
     this.skipframe = true;
 }
示例#3
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;
         }
     }
 }
示例#4
0
 public void State(AniElement elem, bool bimmediate = true, Action whenplay = null)
 {
     element_state = elem;
     if (whenplay != null)
     {
         if (monitor == null)
         {
             monitor = new Dictionary <AniElement, Action>();
         }
         monitor[elem] = whenplay;
     }
     if (bimmediate && elem != null && element_queue.Count == 0)
     {
         curfstart  = element_state.framestart;
         curfend    = element_state.frameend;
         cureloop   = element_state.loop;
         _data      = element_state.ani;
         curframeid = 0;
         timer      = 0;
         instate    = true;
     }
 }
示例#5
0
 public void State(AniElement elem, bool bimmediate = true, Action whenplay = null)
 {
     element_state = elem;
     if (whenplay != null)
     {
         if (monitor == null) monitor = new Dictionary<AniElement, Action>();
         monitor[elem] = whenplay;
     }
     if (bimmediate && elem != null && element_queue.Count == 0)
     {
         curfstart = element_state.framestart;
         curfend = element_state.frameend;
         cureloop = element_state.loop;
         _data = element_state.ani;
         curframeid = 0;
         timer = 0;
         instate = true;
     }
 }
示例#6
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;
         }
     }
 }
示例#7
0
 public SpriteAniController(AniElement state)
 {
     //this.data = data;
     this.element_state = state;
     this._data = state.ani;
     if (element_state != null)
     {
         curfstart = element_state.framestart;
         curfend = element_state.frameend;
         cureloop = element_state.loop;
         _data = element_state.ani;
         curframeid = 0;
         timer = 0;
     }
     this.bplay = true;
     instate = true;
     this.skipframe = true;
 }
示例#8
0
 public object Clone()
 {
     AniElement newobj = new AniElement(this.ani, this.framestart, this.frameend, this.loop);
     newobj.life = this.life;
     return newobj;
 }