public int frameend; //结束帧 public object Clone() { AniElement newobj = new AniElement(this.ani, this.framestart, this.frameend, this.loop); newobj.life = this.life; return(newobj); }
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; }
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; } } }
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; } }